in reply to How to read contents of directory into an array?

You should lookup the functions opendir and readdir. Here is an example:
my @files; opendir (DIR,"my/dir") || die $!; @files = readdir (DIR); closedir (DIR) || die $!;