in reply to Print debug information from Net::FTP
as well as the fact that it's happening 3/4 times makes me think that there's some sort of network connectivity issues. To isolate and confirm this,Error executing run mode 'send_file': Cannot connect to host: Net::FTP +: connect: timeout at /home/domains/xxx/www.xxx.com/aa/system/modules +//FTP.pm line 16. at /home/domains/xxx/www.xxx.com/aa/index.cgi line +20
Note that I used croak instead of die, which will give you more verbose information.use Carp; .... my $ftp = Net::FTP->new("XXX.XX.XX.XXX", Debug => 1, Port => 21, => Ti +meout => 300) or croak "Cannot connect to host: $@";
my $ftp = Net::FTP->new("XXX.XX.XX.XXX", Debug => 1, Port => 21, => Ti +meout => 300); my $num_tries = 0; my $max_tries = 5 #you decide how many times you want to try while ( !$ftp) { if ($num_tries< $max_tries) ) { ++$num_tries; $ftp = Net::FTP->new("XXX.XX.XX.XXX", Debug => 1, Port => 21, + => Timeout => 300); } if ($num_tries >= $max_tries) ) { croak "Cannot connect to host, failed after $num_tries times +: $@"; } }
-- Burvil
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Print debug information from Net::FTP
by boboson (Monk) on Apr 02, 2006 at 14:17 UTC |