daverave has asked for the wisdom of the Perl Monks concerning the following question:
or sometimes I use glob, but anyway, I always need to add a line or two to filter out . and .. which is quite annoying.my $dir="/path/to/dir"; opendir(DIR, $dir) or die "can't open $dir: $!"; my @files = readdir DIR; closedir DIR;
How do you usually go about this common task?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How do you list all files under a directory?
by Corion (Patriarch) on Sep 22, 2010 at 17:48 UTC | |
|
Re: How do you list all files under a directory?
by toolic (Bishop) on Sep 22, 2010 at 18:18 UTC | |
|
Re: How do you list all files under a directory?
by superfrink (Curate) on Sep 22, 2010 at 18:25 UTC | |
|
Re: How do you list all files under a directory?
by perl-diddler (Chaplain) on Sep 22, 2010 at 21:53 UTC | |
|
Re: How do you list all files under a directory?
by Proclus (Beadle) on Sep 22, 2010 at 22:03 UTC | |
|
Re: How do you list all files under a directory?
by Marshall (Canon) on Sep 26, 2010 at 11:56 UTC | |
|
Re: How do you list all files under a directory?
by dasgar (Priest) on Sep 23, 2010 at 06:07 UTC |