On Tue, Dec 14, 2004 at 06:52:57PM +0200, bzzt ([EMAIL PROTECTED]) 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 => [EMAIL PROTECTED] => www.petdance.com => AIM:petdance