in reply to Re^2: How to FTP with Timeout?
in thread How to FTP with Timeout?

This is untested but you could try to put an eval-alarm combination in there to time the get. Something like:
#!/usr/bin/perl use warnings; use strict; use Net::FTP; $ftp = Net::FTP->new("some.host.name", Debug => 0); $ftp->login("anonymous",'-anonymous@'); my $timeout = 60; my $time; eval { local $SIG{ALRM} = sub { die "timeout!" }; alarm $timeout; $ftp->cwd("/pub"); $ftp->get("that.file"); $ftp->quit; $time = alarm 0; } if ($@) { if ( $@ =~ /timeout/ ) { #do something } else { #do something else for other failures } } else { print "External call finished in " . ( $timeout - $time ) . " seco +nds\n"; }

I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh