I'm not able to use perl function time() in a callback function called by request
function on LWP::UserAgent object.
$ua->request immediately terminates. Response object does not indicate any error,
though.
Am I doing anything wrong here ??
sub callback
{
shift $a;
shift $b;
shift $c;
my $t = time();
}
my $ua = new LWP::UserAgent ;
$ua->timeout (1200) ;
$ua->agent ('getfile.pl') ;
my $req = new HTTP::Request ('GET', $ARGV[0]) ;
$req->header (Pragma => 'no-cache') ;
open FILE, ">$ARGV[1]" ;
print "source -> $ARGV[0]\n";
print "dest -> $ARGV[1]\n\n";
my $resp = $ua->request ($req, \&callback) ;
if (! $resp->is_success()) {
print "Error retrieving data ... ",
$resp->code (), ' ', $resp->message (), "\n\n" ;
exit (1) ;
}
Nitin Sane
[EMAIL PROTECTED]