You can roll your own thusly:
my @param = qw( *.txt *.p? ); print "$_\n" for find( \@param, 'c:/' ); sub find { my ($finds, $dir) = @_; $dir ||= './'; # defult to CWD if no dir supplied opendir D, $dir or die "Can't read $dir $!"; my @file_list = grep { ! -d $dir.$_ and ! -l $dir.$_ }readdir D; closedir D; my @terms; # modify * to .* and ? to . and quotemeta rest so regex friendly for my $term (@$finds) { $term = quotemeta $term; $term =~ s/\\\*/.*/g; $term =~ s/\\\?/./g; push @terms, $term; } # build regex my $re = '(?:' . (join "|", @terms) . ')'; $re = qr/$re/; return grep { /^$re\z/s } @file_list; }
cheers
tachyon
s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print
In reply to Re: Listglob
by tachyon
in thread Listglob
by PetaMem
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |