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

You want to open the directory (handle) and read all filenames into an array using readdir. This will read all files (including . and .. into the array). From here you can use a foreach loop to iterate throught he array and do what you want:
my $directory = 'c:\windows'; opendir(DIR,$directory); my @files = readdir(DIR); closedir(DIR); foreach(@files){ print $_,"\n"; }
I hope this gets you going in the right direction...

Mick

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