in reply to How do I read all the file names of a directory into an array?
you can also use readdir in scalar context to just return the next item in the directory.my $directory="/home/myuser/mp3s"; opendir(DIR, $directory) or die "couldn't open $directory: $!\n"; my @files = readdir DIR; closedir DIR;
|
|---|