in reply to Problem with -d inside find sub
I think your confusion comes from ignoring this part of the File::Find documentation:
Additionally, for each directory found, it will "chdir()" into that directory and continue the search, invoking the &wanted function on each file or subdirectory in the directory.
So the path in $f is always relative (because static is a relative path), and the calls to chdir that File::Find performs take care that the file tests never find the file that you think should be found.
Either pass the no_chdir => 1 option to &find, or do the file checks on $_ instead of $File::Find::name.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Problem with -d inside find sub
by randian (Acolyte) on Apr 27, 2012 at 01:01 UTC | |
by Anonymous Monk on Apr 27, 2012 at 02:28 UTC | |
by randian (Acolyte) on Apr 27, 2012 at 09:34 UTC | |
by Anonymous Monk on Apr 27, 2012 at 14:31 UTC | |
|
Re^2: Problem with -d inside find sub
by randian (Acolyte) on Apr 27, 2012 at 09:34 UTC | |
by Anonymous Monk on Apr 27, 2012 at 12:01 UTC | |
by randian (Acolyte) on Apr 27, 2012 at 14:18 UTC | |
by Anonymous Monk on Apr 28, 2012 at 11:33 UTC |