Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re: FTP Script

by pc88mxer (Vicar)
on Jul 28, 2008 at 21:19 UTC ( #700661=note: print w/ replies, xml ) Need Help??

in reply to FTP Script

This is in the libnet FAQ: (link):

Why does Net::FTP not implement mput and mget methods

The quick answer is because they are easy to implement yourself. The long answer is that to write these in such a way that multiple platforms are supported correctly would just require too much code. Below are some examples how you can implement these yourself.

sub mput { my($ftp,$pattern) = @_; foreach my $file (glob($pattern)) { + $ftp->put($file) or warn $ftp->message; } } sub mget { my($ftp,$pattern) = @_; foreach my $file ($ftp->ls($pattern +)) { $ftp->get($file) or warn $ftp->message; } }

Comment on Re: FTP Script
Select or Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (9)
As of 2015-11-26 10:47 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (697 votes), past polls