greenhorn has asked for the wisdom of the Perl Monks concerning the following question:
walktree('d:/perl'); sub walktree { print "$_[0]\n"; # or real-world stuff here for ( glob("$_[0]/*") ) { -d && walktree($_); } }
or these alternatives:
To my amazement, they worked, though I'm still not entirely sure why.for (grep(-d, glob("$_[0]/*"))) { walktree($_); } walktree($_) for (grep(-d, glob("$_[0]/*")));
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: More on directory recursion
by Ovid (Cardinal) on Jun 12, 2000 at 22:40 UTC | |
by takshaka (Friar) on Jun 12, 2000 at 22:51 UTC |