Might want to check out ncftp client. Works very well, multiple platform support and free! I use it for nearly all my batch ftp needs (albeit I have only used the Solaris version...)
http://www.ncftp.com/ncftp/ -Dan > -----Original Message----- > From: Siegfried Heintze (Aditi) [mailto:[EMAIL PROTECTED] > Sent: Wednesday, March 26, 2008 12:50 PM > To: beginners@perl.org > Subject: How to ftp all the files? > > I'm using perl 5.8.8 on cygwin/windows 2003 server. > > This worked (but it was sooooo tedious!): > $ perl -MNet::FTP -e '$ftp =Net::FTP->new("mediaftp.wiley.com", Debug=>0) > or die "cannot connect"; $ftp->login("download","download") or die "cannot > login"; $ftp->cwd("/product_ancillary/76/04701913/DOWNLOAD/") or die > "cannot cd"; for (3..5) { print "getting $_\n" ; $ftp->get("ch". > sprintf("%-2.2d",$_). " CodeSample.zip") or die "cannot get" ; } '; > > Questions: > > 1. Is there an easier way? > > 2. More specifically: Are there some perl modules that will parse > the string > ftp://download:[EMAIL PROTECTED]/product_ancillary/76/04701913/D > OWNLOAD/Ch05%20CodeSample.zip and download the file with one or two > function calls instead of what I did above? > > 3. I tried calling mget but there was no such function. How could I > wild card and get all the zip files in that directory? I was looking at > http://search.cpan.org/~jdlee/Net-FTP-Recursive-2.02/Recursive.pm and > wondering if this would solve my problem. Can someone help me modify my > fragment above so it recursively fetches the entire directory? I was not > sure how to pass that function pointer in the example in the > documentation. > > 4. Is perl the best way to do this? Would it be easier in some other > language/library like bash or python or ruby? > Thanks! > Siegfried -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/