Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Net::FTP

by RMGir (Prior)
on Oct 01, 2003 at 18:00 UTC ( [id://295711]=note: print w/replies, xml ) Need Help??


in reply to Net::FTP's get() does not handle wildcards

I like princepawn's answer.

But just in case downloading a different module isn't an option, why not do what mget does yourself? All you need to do is grep through the results of ls to select the files to download.

use POSIX qw(strftime); use Net::FTP; foreach my $host(@hosts) { $ftp = Net::FTP->new($host); # you probably want to use a different login $ftp->login("anonymous",'nairod@wherever.net'); # just in case... $ftp->binary(); $ftp->cwd("/whatever/place/shars/are"); my @files=grep /${host}shar\d{6}\.\d{4}/,$ftp->ls(); foreach(@files) { $ftp->get($_); } $ftp->quit(); }
I think that might do what you want, but it's untested.
--
Mike

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://295711]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2024-03-29 00:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found