Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

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]
LanX thx Lanx
[shmem]: python sucks
[LanX]: keep your sexlife private, please!
[LanX]: ;-p
shmem spent 3 hours chasing a bug related to variable scoping
[shmem]: is there an equivalent to my in python? or 'use strict' ?
[LanX]: I doubt
[LanX]: only nonlocal in Py3

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (10)
As of 2018-03-20 17:48 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (256 votes). Check out past polls.