Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: greater efficiency required (ls, glob, or readdir?)

by jethro (Monsignor)
on Aug 27, 2008 at 18:19 UTC ( #707245=note: print w/replies, xml ) Need Help??


in reply to greater efficiency required (ls, glob, or readdir?)

|| !$_ is possibly unsafe, you would ignore a file named '0'

Also usually 'or' is better than '||' because of lower precedence (doesn't make a difference here though)

Replies are listed 'Best First'.
Re^2: greater efficiency required (ls, glob, or readdir?)
by ikegami (Pope) on Aug 27, 2008 at 18:48 UTC

    || !length($_) (Upd: or better yet || !/\S/ ) would be the solution.

    || is fine. It's being used to join expressions, not statements.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (5)
As of 2020-11-28 11:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?