According to the output supplied, it appears that the poster of this question is attempting to connect to the FTP from a machine with a private class address - This host address, along with the preferred socket for data communications, are sent to the server via the PORT command. I would suspect that the poster is connecting to the FTP server host through a network firewall or layer of address translation and as such, the data connection from the server to your machine is failing because the FTP server is unable to reach your private machine.
The means by which to fix this is to switch to passive FTP transfer mode via the PASV command - This command changes the default behaviour of data port negotiation, shifting the onus for responsibility for data port establishment and maintenance back to the client. This allows the client to control its only data connection through the network firewall or translation layer, allowing normal FTP communications to occur. eg.
- use Net::FTP; # Passive mode can be set with object initiation my $ftp = Net::FTP->new( $hostname, Debug => 1, Passive => 1 ) or die +$!; $ftp->login( $user, $password ); # Or with $object->pasv; $ftp->pasv;
Further information on this topic can be found in RFC documents File Transfer Protocol, Requirements for Internet hosts - communication layers and Firewall-Friendly FTP.