Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Am I on the right track?

by AnomalousMonk (Archbishop)
on Jun 19, 2015 at 00:31 UTC ( [id://1131092]=note: print w/replies, xml ) Need Help??


in reply to Am I on the right track?

my @files = grep {!/^\./ && -f "$dir"."data2/$_" } readdir($dh);

A small point: If you're trying to filter out the . and .. directories from what you are reading from the directory handle, be aware that  !/^\./ will also filter out files named something like '.foo'. The idiomatic pattern to use here would be  !/^\.\.?$/ or maybe  m{ \A [.]{1,2} \z }xms instead.


Give a man a fish:  <%-(-(-(-<

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (7)
As of 2024-03-28 21:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found