in reply to Hard to find bug in my File::Find code
It gets more complicated if you visit 2 special directories in a row. In your case you visit /shared/ITReg and add to $depth, but that is the last /shared/* directory. Therefore when you enter /home, $depth decreases by one and you get /home rather than subdirectories.
The solution is that rather than trying to manipulate a global $depth as you walk the tree, within each invocation of &wanted calculate $depth from first principles.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Hard to find bug in my File::Find code
by Zenshai (Sexton) on Aug 29, 2008 at 20:03 UTC |