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/DOWNLOAD/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