http://qs321.pair.com?node_id=707245


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 (Patriarch) 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.