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

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?

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (10)
As of 2016-10-26 10:21 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (340 votes). Check out past polls.