Beefy Boxes and Bandwidth Generously Provided by pair Networks Frank
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^3: Is this the most elegant way to code directory lookup?

by hv (Parson)
on Oct 02, 2006 at 10:18 UTC ( #575858=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Is this the most elegant way to code directory lookup?
in thread Is this the most elegant way to code directory lookup?

Update: Looks like I'm wrong.

I disagree: just because someone tried it once and got a useful error message doesn't change the fact that $! is not documented to be defined at this point.

$! may well get set differently (or not at all) in different circumstances, when testing different files, or on a different O/S, or depending on phase of the moon for all we know.

Your suggested clearer error messages are definitively more correct; the only change I might make (at the risk of getting too clever) is to avoid the duplication with something like:

die "$_ is not a valid directory\n" for grep !-d, $srcdir, $destdir;

Hugo


Comment on Re^3: Is this the most elegant way to code directory lookup?
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (7)
As of 2014-04-18 03:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (461 votes), past polls