Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

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 drinking their drinks and smoking their pipes about the Monastery: (2)
As of 2017-04-27 23:56 GMT
Find Nodes?
    Voting Booth?
    I'm a fool:

    Results (514 votes). Check out past polls.