Subject: | Refused connection generates fatal error |
If the ftp host refuses the connection, Net::FTP::Throttle has a fatal
error as follows:
Can't use an undefined value as a symbol reference
at /usr/lib/perl5/site_perl/5.8.0/Net/FTP/Throttle.pm line 37.
I believe it should fail gracefully, returning an error to the calling
script, which can then take action as appropriate.
I have corrected this on my system by modifying Throttle.pm...
Inserted after line 22, Throttle.pm:
defined $self or return undef;
My installation details:
Net-FTP-Throttle-0.29
perl v5.8.7
Linux 2.6.11-gentoo-r4 i686
The code I used to replicate this:
use Net::FTP::Throttle;
my $ftp = Net::FTP::Throttle->new('217.151.109.191',
MegabitsPerSecond => 1)
or warn "Cannot connect: $@";
Many thanks for the module. I've found it very useful!
Nick