Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

Re^5: Net::FTP::Recursive code not downloading files

by tangent (Priest)
on Dec 14, 2013 at 12:15 UTC ( #1067131=note: print w/replies, xml ) Need Help??

in reply to Re^4: Net::FTP::Recursive code not downloading files
in thread Net::FTP::Recursive code not downloading files

Why would I need to run the code for each directory separately? Isn't that the whole point of recursion, so it will drill down into each directory until there are no more levels?
MatchDirs is not doing what you think - it is not saying "if a directory matches this pattern go in and recurse". What it is saying is "for every directory do not enter unless its name matches this pattern". Changing the pattern will not help as it tests against the directory name not the path.

Peeking into the Module's relevant code may help:

elsif ( $file->is_directory() ) { if( ( $options{MatchDirs} and $filename !~ $options{MatchDirs} ) or ( $options{OmitDirs} and $filename =~ $options{OmitDirs} )){ next FILE; }

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1067131]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2017-12-11 07:59 GMT
Find Nodes?
    Voting Booth?
    What programming language do you hate the most?

    Results (288 votes). Check out past polls.