The grep should probably check if it's a file, not a directory:
my @files = grep { -f && /[A-Za-z]{2}_\w{2,5}/ }, readdir $dir;
----
I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
-- Schemer
Note: All code is untested, unless otherwise stated
In reply to Re: Re: glob and regex
by hardburn
in thread glob and regex
by AlisonA
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |