ady has asked for the wisdom of the Perl Monks concerning the following question:
use strict; use warnings; use Data::Dumper; my $path = shift @ARGV; opendir (DIR, $path) or warn "Couldn't open $path: $!"; my @dirs = sort readdir(DIR); closedir(DIR); print "$path\n\t", Dumper(\@dirs);
in a directory containing two subdirectories (besides the current & parent dirs; -- this is as expected).C:\tmp>test.pl "C:\Documents and Settings\z6and\Desktop\x" C:\Documents and Settings\z6and\Desktop\x $VAR1 = [ '.', '..', '328-24.08.2006-14.30', '335-25.08.2006-06.40' ];
which is NOT what i expect, as all four entries in the above listing are indeed directories...C:\tmp>test.pl "C:\Documents and Settings\z6and\Desktop\x" C:\Documents and Settings\z6and\Desktop\x $VAR1 = [ '.', '..' ];
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: -d misses some directories ?
by Corion (Patriarch) on Aug 27, 2006 at 18:32 UTC | |
by ady (Deacon) on Aug 27, 2006 at 18:37 UTC |