in reply to Re: Re: Re: How do I put all sub-directories into an array?
in thread How do I put all sub-directories into an array?
Since you never fix up $dir to be the path including the directory name, this test is guaranteed to fail, except under the random moment when a directory below /home/www is also in the current directory. See the other solutions in this thread for working examples, of which yours is not.next if $dir =~ /^\.\.?$/ || ! -d $dir;
Code is untested but should work.Where "should" here means "I would like it to", not "it does". {grin}
-- Randal L. Schwartz, Perl hacker
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: •Re: Re: Re: Re: How do I put all sub-directories into an array?
by kodo (Hermit) on Jul 23, 2002 at 16:59 UTC |