In Perl, you can get a list of files that match a pattern:
my @list = <*.txt>;
print "@list";
Now, I'd like to pass the pattern as a variable (because it's passed into a function). But that doesn't work:
sub ProcessFiles {
my ($pattern) = @_;
my @list = <$pattern>;
print "@list";
}
readline() on unopened filehandle at ...
Any suggestions?