in reply to Net::FTP is NEVER successful
Not sure if this is quite what you are after, but it might be useful generally speaking.#!/usr/bin/perl list = $ARGV[0]; $ftp = "/usr/bin/ftp"; $ftptmp="filename.txt"; $ftphost = "<ftp host>"; $ftpdir = "<ftp directory>"; open(LIST, "$list") || die "ERROR: Unable to open $list FILE: $!\n"; while(<LIST>) { @fields = split; $file = $fields[0]; # get file from ftp site print "Retrieving file from FTP site ...\n"; open(FTP, "|$ftp -n $ftphost > $ftptmp"); print FTP "user anonymous "; print FTP "password <email address>\n"; print FTP "cd $ftpdir\n"; print FTP "get $file\n"; print FTP "bye"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Net::FTP is NEVER successful
by dbae (Beadle) on Jul 28, 2005 at 21:25 UTC |