Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: mkdir die

by DrManhattan (Chaplain)
on Oct 20, 2001 at 00:19 UTC ( #120137=note: print w/replies, xml ) Need Help??


in reply to mkdir die

(Original reply went to a duplicate node)

Use 'or' rather than '||'. The precedence of 'or' is much lower, so everything to the left of it will be evaluated, rather than the first expression directly to the left. Explicitly parenthesized, your command looks like this:
mkdir $DIR_LOCATION, (0777 || die "sigh");
Which evaluates to
mkdir $DIR_LOCATION, 0777;
Using 'or', it's like this:
(mkdir $DIR_LOCATION, 0777) or (die "sigh");
The entire mkdir() expression is evaluated.

-Matt

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (5)
As of 2019-10-21 03:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?