in reply to How do I read all the file names of a directory into an array?

You can alse use DirHandle.

Like so:
my $dhandle = new DirHandle "/directory/to/foo"; #or my $dhandle = new DirHandle "."; for #current directory, if you like if (defined($dhandle)){ while (defined($_ = $dhandle->read)){ push @filename_array,$_; } } undef($dhandle);

This is pretty much from the DirHandle manpage
also, so it's well documented. And I like it.

--
-felonious
  • Comment on Re: How do I read all the file names of a directory into an array?
  • Download Code