Hello,
thank you all, at this moment I don't need a solution involving anything neither nuclear fly swatters: I show the hammer to the bolt and that became a nail.
I needed something a bit more kinky that I told you in the first mail - to delete all the posts too much short in a very long newsgroup - and I hoped there was a function (like getline, for instance) to do it. Your advices and prompts showed me a different way:


(not already tested)
(some variables are descriptive)

my $post_marker = "========";
my @partial = an array in which I'll store all the lines;
my @definitive = an array in wich I'll copy anly the posts that interest me;
my $text = the clean text string;
my $actual= the line I'm reading;
my $first_line = 1;


while(<>){
        unless /\n(?!========)/
                {push @partial, $_;}
        else{
                $actual = $.;
                $lenght = $. - $first_line;
                if ($lenght > 30){
                        foreach $partial(@partial) {$text .= $partial;}
                        $first_line = $actual;
                        @partial = "";
                        }
                else {
                        precendete = attuale
                        array dei testi = "";
                altrimenti
                        $first_line = $actual;
                        @partial = "";
                        }
                }

Maybe I could make it better.
(advices are much appeciated),

all'adr



Mercoledì, 26 Mar 2003, alle 18:42 Europe/Rome, Perry, Alan ha scritto:

Rob Dixon wrote:

Michael Weber wrote:
I know this is a perl list, but just because you have a hammer in your
hand doesn't make everything a nail, right?


How about <also untested>

sed '132,134d' datafile > newfile

I also have a solution involving a hydraulic jack and a pint of whipped cream if anybody's interested...

I have a nuclear-powered fly swatter if that helps...


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to