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

Re: mkdir die

by RhetTbull (Curate)
on Oct 20, 2001 at 00:24 UTC ( #120141=note: print w/ replies, xml ) Need Help??


in reply to mkdir die

I posted this on of the duplicate copies of this node but it got reaped so here it is again. As blakem pointed out, it's a matter of operator precedence. This gets interpreted as mkdir $DIR_LOCATION, (0777 || die "sigh"); Use parens on your mkdir call:

eval { mkdir ($DIR_LOCATION, 0777) || die "sigh"; }; if ($@) { print "Never gets here to display error message."; }
blakem's solution works too since or has lower precedence than || but I personally prefer parens and ||. Either way works fine -- do whicher you like better. --RT


Comment on Re: mkdir die
Select or Download Code
Replies are listed 'Best First'.
Re: Re: mkdir die
by zakzebrowski (Curate) on Oct 22, 2001 at 18:02 UTC
    Thanks everyone. Forgot about the ()'s & precedence... Using opera for my web browser and for some reason it reposted the question for the duplicate nodes... sorry about that. Anyway, thanks for helping me get it to work!

    ----
    Zak

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (13)
As of 2015-07-29 22:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (269 votes), past polls