I swear once, many years ago, someone showed me something similar to $var || $var = 1;Probably what they showed you was: $var ||= 1; which sets $var to 1 unless it evaluates to true.
Note this is not the same as perl 5.10's // operator since the assignment will take place if $var is 0 or the empty string in addition to undef.
In reply to Re: Checking the value of an undefined value
by pc88mxer
in thread Checking the value of an undefined value
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |