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

lucky for you.. perl has built in functions for this:
my $directory="/home/myuser/mp3s"; opendir(DIR, $directory) or die "couldn't open $directory: $!\n"; my @files = readdir DIR; closedir DIR;
you can also use readdir in scalar context to just return the next item in the directory.
-brad..
  • Comment on Re: How do I read all the file names of a directory into an array?
  • Download Code