Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Net :: FTP

by aitap (Deacon)
on Sep 04, 2012 at 18:53 UTC ( #991679=note: print w/replies, xml ) Need Help??


in reply to Net :: FTP

First, set up a list of directories.

$f->cwd($dir) or die "Can't cwd to $dir\n";
Next, instead of dieing in case of inability to CWD, switch to the next list element in a foreach loop.

For example:

my @directories = qw/code test/; foreach my $dir (@directories) { $f->cwd("/home/$dir") || next ... # your code to fetch the files }

Sorry if my advice was wrong.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://991679]
help
Chatterbox?
Corion relaxes. The books for our Perl club are "done" and ready for review.

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (12)
As of 2017-11-21 16:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (305 votes). Check out past polls.

    Notices?