* means one thing in filename wildcards and another in regexes. It does work in glob().
use Cwd; my $dir = getcwd; opendir DIR, $dir; my $filter = shift; $qfilter = quotemeta $filter; $qfilter =~ s/\\\*/.*/; $qfilter = qr($qfilter); my @regfiles = grep { -f ; /$qfilter/ } readdir DIR; seekdir DIR,0; @globfiles = glob($filter); closedir DIR; print "$_\n" for @regfiles; print "\n"; print "$_\n" for globfiles;
In reply to Re: Loading an array with file names
by GotToBTru
in thread Loading an array with file names
by insta.gator
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |