The thing that kills me is that time after time, the $ftp->put() operation times out. I can use FTP from the shell and mput my data to the FTP server without any problems. What have I done wrong? Why does this simple code torment me so? I also checked out my glob() by printing the output to screen, and that looks okay. The foreach() also shows that its uploading one file at a time. As an aside, file size ranges between 170Mb and 180Mb per file. Your assistance would be greatly appreciated.# Pattern match all .ipup files in local directory my @files = glob("*.ipup"); # Declare $ftp my $ftp; $ftp = Net::FTP->new($ulservername, Debug => 1, Timeout => 120, Hash = +> \*STDERR) or die "Cannot connect the FTP server called $ulservernam +e.\n"; $ftp->login($username,$password) or die "Authentication on $ulserverna +me failed\n"; $ftp->binary() or die "Could not set BINARY command on $ulservername\n +"; $ftp->cwd($rdirectory) or die "Could change working directory on $ulse +rvername\n"; # Execute the FTP transfer foreach my $file (@files) { print "Copying $file to FTP server...\n"; $ftp->pasv() or die "Could not set PASV command on $ulservername\n" +; $ftp->put($file, $file) or die "Could not transfer $file to FTP ser +ver: $!\n"; } # Send quit to FTP server $ftp->quit() or die "Could not quit the FTP session. Que sera sera\n";
In reply to Net::FTP insanity by NoSignal
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |