in reply to Net::FTP is NEVER successful

Just out of interest, why use Net::FTP? I've always found that something along these lines works a treat. All you need is a text file read from the command line stating which files you require (although you can change this obviously if you arent keen)
#!/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"; }
Not sure if this is quite what you are after, but it might be useful generally speaking.
p.s. Could you please do something about the font .. I think you have everything wrapped around code tags at the moment making your post rather difficult to read. lol

Replies are listed 'Best First'.
Re^2: Net::FTP is NEVER successful
by dbae (Beadle) on Jul 28, 2005 at 21:25 UTC

    Thanks for this. It looks like a script I will use.

    The reason I used the automated system is that, as a newbie, I don't know which directories .tar.gz files should be downloaded to on my system. Also, at the beginning, there are large numbers of tarballs to download. It's nicer to use cpan's automated discovery of prerequisite packages that need to be downloaded than to discover them one by one.

    Thanks for your help

    David