Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Re^2: File name filtering with ^ ?by xicheng (Sexton) |
on Mar 20, 2007 at 05:50 UTC ( [id://605643]=note: print w/replies, xml ) | Need Help?? |
[\d\w] is the same as \w, and adding an anchor to the regex pattern might be more efficient: push @files, $_ if /^\w[^TV]/; or simply: my @files = grep {/^\w[^TV]/} glob("*.pl"); or try shell to negate the character-class: my @files = glob("h[!TV]*.pl"); Regards, Xicheng
In Section
Seekers of Perl Wisdom
|
|