in reply to Read a list of files into an array

Or, even more compact way to use glob,

my $dir = "/path/to"; # or however you initialize my @array = <$dir/*.txt>;
to get files with the .txt extension. If you want to consider all files for more accuracy, use -f and File::Type to filter <$dir/*>.

After Compline,
Zaxo