logo       
Google Custom Search
    AddThis Social Bookmark Button

Re: WWW::Mech and range operator: msg#00006

Subject: Re: WWW::Mech and range operator
On Wed, 5 May 2004, stu meacham wrote:

 What would be the best way to print out a range of lines from the content with 
2 different delimiters?  Do I have to make the content a file first and then 
open a filehandle?  Thanx, Stu

I often use something like:

my $content = $mech->content(); # make a copy since this operation is 
descructive 

while ($content =~ s!(some pattern)!!) {
        my $line = $1;
        print $line;
}

you will only be in the while loop if your pattern match succeeded on that 
line so you dont have to check inside the loop.

gedanken
 





Try Searching:
servers, voip, java, networking, microsoft ...
<Prev in Thread] Current Thread [Next in Thread>