Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
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.


Comment on Re: Net :: FTP
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2015-07-04 18:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (60 votes), past polls