in reply to Net:FTP timeout handaling

Looking at the Net::FTP and Net::Cmd modules, it is clear that exceptions are not thrown when timeouts occur. However, it looks like undef will be returned if a command times out.

Try something like this (n.b. untested code):

my $list = $ftp->dir(); unless ($list) { ...dir timed out or other error... } for (@$list) { # process each directory entry }
Update: The timeout messages are emitted using carp which is equivalent to warn, and that is why you are seeing them but cannot catch them by using an eval block. Just search for 'Timeout' in Net/Cmd.pm.