Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
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?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (2)
As of 2017-08-20 05:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Who is your favorite scientist and why?



























    Results (313 votes). Check out past polls.

    Notices?