http://www.perlmonks.org?node_id=137654

SiN8 has asked for the wisdom of the Perl Monks concerning the following question:

Here's my code:
use Net::FTP; my $hostname="hostname"; my $user="user"; my $password="pass"; $ftp=Net::FTP -> new("$hostname",Debug=>1) or die ("Connect failed"); $ftp->login("$user","$password"); $ftp->binary; $ftp->put("filename.ext")
Here's the output:
Net::FTP: Net::FTP(2.62) Net::FTP: Exporter Net::FTP: Net::Cmd(2.20) Net::FTP: IO::Socket::INET Net::FTP: IO::Socket(1.1603) Net::FTP: IO::Handle(1.1505) Net::FTP=GLOB(0x81b3320)<<< 220 Server ready. Net::FTP=GLOB(0x81b3320)>>> user user Net::FTP=GLOB(0x81b3320)<<< 331 Password required for user. Net::FTP=GLOB(0x81b3320)>>> PASS .... Net::FTP=GLOB(0x81b3320)<<< 230 User user logged in. Net::FTP=GLOB(0x81b3320)>>> TYPE I Net::FTP=GLOB(0x81b3320)<<< 200 Type set to I. Net::FTP=GLOB(0x81b3320)>>> PORT 10,1,4,49,219,108 Net::FTP: Unexpected EOF on command channel at script.cgi line 37
What does the EOF mean here? It also occurs for $ftp->ls(). How can I fix this?