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?

next if $dir =~ /^\.\.?$/ || ! -d $dir;
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.

Code is untested but should work.
Where "should" here means "I would like it to", not "it does". {grin}

-- Randal L. Schwartz, Perl hacker

  • Comment on •Re: Re: Re: Re: How do I put all sub-directories into an array?
  • Download Code

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
    hi merlyn,
    sorry I was in a hurry when writing this one, of course it would fail if /home/www issn't the current dir :)

    giant