I have the following very simple piece of code:
#!/usr/bin/perl
use strict;
use warnings;
use WWW::Mechanize::Timed;
my $ua = WWW::Mechanize::Timed->new();
my $url = 'www.stackoverflow.com';
$ua->get($url);
print "Total time: " . $ua->client_total_time . "\n";
print "Elapsed time: " . $ua->client_elapsed_time . "\n";
The error I am getting:
When running the program I sometimes get the following error, it does not happen all the time, its seems to appear intermittently.
Use of uninitialized value in addition (+) at /usr/local/share/perl/5.10.1/WWW/Mechanize/Timed.pm line 52.
Is there something obvious I am overlooking, as I cant understand why this error is occurring, let alone why it only happens sometimes?
Your help is much appreciated, many thanks