Re: Printing and fetching pages
am 14.12.2004 17:06:09 von AndyOn Tue, Dec 14, 2004 at 06:52:57PM +0200, bzzt (bzzt@vivodinet.gr) wrote:
> hi,
>
> the following code gets the page first and then prints the message
> "intializing" although it's written the other way.
>
> use warnings;
> use strict;
> use WWW::Mechanize;
> my $agent = WWW::Mechanize->new();
> print "intializing";
> $agent->get('http://www.thecityvibe.com/forum/');
> die "Can't even get the home page: ", $agent->response->status_line
> unless $agent->success;
The print statement is buffered. You can turn off buffering by putting
$|=1;
at the top of your program.
Also, if you don't want to check the return code manually, you can say:
my $agent = WWW::Mechanize->new( autocheck => 1 );
xoxo,
Andy
--
Andy Lester => andy@petdance.com => www.petdance.com => AIM:petdance