Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Re: Net::FTP

by Anonymous Monk
on Feb 27, 2003 at 18:30 UTC ( #239194=note: print w/replies, xml ) Need Help??

in reply to Net::FTP

I'm trying to do a GET on files that match a certain pattern. I don't see where the Net::FTP function support like 'mget' etc. I only see 'get'. Any ideas on how this could be implemented? Paul Menard

Replies are listed 'Best First'.
Re: Re: Net::FTP
by pfaut (Priest) on Feb 27, 2003 at 19:06 UTC

    You can implement mget by getting a list of files with 'ls', searching the files you want by passing the returned list through perl's 'grep' and performing a 'get' on the resulting list. Something like the following (untested):

    $ftp->get($_) for grep /\.txt$/, $ftp->ls;
    --- print map { my ($m)=1<<hex($_)&11?' ':''; $m.=substr('AHJPacehklnorstu',hex($_),1) } split //,'2fde0abe76c36c914586c';

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2021-12-09 10:29 GMT
Find Nodes?
    Voting Booth?
    R or B?

    Results (36 votes). Check out past polls.