in reply to 'or' vs '', '&&' vs 'and'
A lot of people have already mentioned the precedence, in particular with open. An example implementing both would be:
If you don't know how something will be parsed, use B::Deparse, and have it add a lot of parenthesis using -p:open FILE, $file || 'default.txt' or die "Can't open: $!";
Which outputs (without color):perl -MO=Deparse,-p -e'open FILE, $file || "default.txt" or die "Canno +t open: $!";'
(open(FILE, ($file || 'default.txt')) or die("Cannot open: $!"));
-e syntax OK
Hope this helps understanding.
U28geW91IGNhbiBhbGwgcm90MTMgY
W5kIHBhY2soKS4gQnV0IGRvIHlvdS
ByZWNvZ25pc2UgQmFzZTY0IHdoZW4
geW91IHNlZSBpdD8gIC0tIEp1ZXJk
|
|---|