]> git.donarmstrong.com Git - infobot.git/commitdiff
fixed perl warnings.
authordms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Mon, 20 Oct 2003 08:23:06 +0000 (08:23 +0000)
committerdms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Mon, 20 Oct 2003 08:23:06 +0000 (08:23 +0000)
git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@852 c11ca15a-4712-0410-83d8-924469b57eb5

src/Net.pl

index 1d167cc04235ee661c6d24673cde934252b256c5..082c8566e16637e68d7c5a6fc9bd90718d513d4c 100644 (file)
@@ -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;
 }