http://qs1969.pair.com?node_id=45942


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

Use opendir, readdir and closedir.
Assuming you don't want '.' or '..' to appear in the list of filenames, the following is probably what you are looking for:
opendir DIR, "directory/"; my @files = grep { $_ ne '.' && $_ ne '..' } readdir DIR; closedir DIR;
  • Comment on Re: How do I read all the file names of a directory into an array?
  • Download Code