This is about scalars and strings.
I did all the excercises and got them right.
I have never been sure when writing code before now (like in a 'die' statement) whether to use || or the OR operator. I am sure it will become apparent or at least more so as I go through the excercises.
I am typing in and testing all the examples as well as doing all the excercises. Learn by doing is the best way.
note: this actually catches me up as I am in the 3rd chapter.
||
has a higher precedence, while or
has a very low precedence. So choose just based on what kind of precedence you want. For example:evaluates the whole RHS as an expression forprint "do" || "die";
print
, whileevaluatesprint "do" or die;
print "do"
and will die()
only when print
fails — for example when printing to a closed filehandle, of to a full disk.
I just hope I seem to make sense.
Re:|| vs. or
zatoichi on 2004-02-25T14:18:49
Actually you did. Thank you very much.
I have never been sure when writing code before now (like in a 'die' statement) whether to use || or the OR operator.