Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
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 examining the Monastery: (7)
As of 2019-03-22 17:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How do you Carpe diem?





    Results (114 votes). Check out past polls.

    Notices?