After filling out a form, following a link, and getting the right content, I would
like to print a range of lines from that content. Like so:
my $mech = WWW::Mechanize->new();
$mech -> get("http://www.website.com");
$mech->form_number( 1 );
$mech->field(login => "username");
$mech->field(password => "secret number");
$mech->submit();
$mech->success or die "post failed: ", $mech->response->status_line;
$mech->follow_link( text_regex => qr/name of link/i );
$mech->success or die "post failed: ", $mech->response->status_line;
$mech->{content} or $mech->content() gives me the content from which
I would like to use the range operator (...) upon. I can't make any kind of line
operator work on the content object, though.
my $file = $mech->{content};
print "$file\n"; # this prints everything
open FH, "$file"; #this no worky
while (<FH>) {
print if m/start_regex/...m/end_regex/;
}
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
____________________________________________________________
Find what you are looking for with the Lycos Yellow Pages
http://r.lycos.com/r/yp_emailfooter/http://yellowpages.lycos.com/default.asp?SRC=lycos10