From: dms Date: Mon, 20 Oct 2003 08:23:06 +0000 (+0000) Subject: fixed perl warnings. X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=994b61dc28b01d0b7af6490fc867d99ea584e0e1;p=infobot.git fixed perl warnings. git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk@852 c11ca15a-4712-0410-83d8-924469b57eb5 --- diff --git a/blootbot/src/Net.pl b/blootbot/src/Net.pl index 1d167cc..082c856 100644 --- a/blootbot/src/Net.pl +++ b/blootbot/src/Net.pl @@ -181,20 +181,23 @@ sub getURL { sub getURLAsFile { my ($url,$file) = @_; my ($ua,$res,$req); + my $time = time(); return unless &loadPerlModule("LWP::UserAgent"); + $ua = new LWP::UserAgent; $ua->proxy('http', $param{'httpProxy'}) if &IsParam("httpProxy"); - my $req = HTTP::Request->new('GET', $url); - my $time = time(); + $req = HTTP::Request->new('GET', $url); &status("getURLAsFile: getting '$url' as '$file'"); - my $res = $ua->request($req, $file); + $res = $ua->request($req, $file); + my $delta_time = time() - $time; if ($delta_time) { my $size = -s $file || 0; my $rate = int($size / $delta_time / 1024); &status("getURLAsFile: Done. ($rate kB/sec)"); } + return $res; }