my $browser = WWW::Mechanize->new( autocheck=>1, agent=>"Firefox/1.0 (compatible; MSIE 6.0)"); my $url=... some url ...; my $filename=... local path name ...; my $response; eval { $response=$browser->get( $url, ":content_file" => "C:/$filename" ) }; if ($@) { print "An error occurred ($@), continuing\n"; }