in reply to Re^6: One out of three ain't bad (! !!)
in thread One out of three ain't bad
(tho' the logic of Boolean diadics not returning Boolean values escapes me...)
It allows idioms such as:
$hostname ||= 'localhost';
Since that is just short for:
$hostname= $hostname || 'localhost';
it'd set $hostname to just 'true' if Boolean operators returned Boolean values. Of course, the above is short-hand for:
$hostname= 'localhost' if ! $hostname;
but the first form is the only one that manages to not repeat $hostname, which can be quite an advantage in some cases, or across a bunch of similar cases. And there are other similar idioms that are useful because of this property.
In any case, it is quite "Perlish".
- tye
|
|---|