Beefy Boxes and Bandwidth Generously Provided by pair Networks
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??


in reply to Re: File name filtering with ^ ?
in thread File name filtering with ^ ?

[\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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://605643]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2024-04-24 20:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found