Or, even more compact way to use glob,
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/*>.my $dir = "/path/to"; # or however you initialize my @array = <$dir/*.txt>;
After Compline,
Zaxo
In reply to Re: Read a list of files into an array
by Zaxo
in thread Read a list of files into an array
by monkeybus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |