You mentioned: $var or $var = 30;
Better as:
which assigns the value if the value of $var is not true. If your code allows $var to be defined but not true at that point (e.g. hold a value of '0'), then use:$var ||= 30;
which will only assign the value to $var if it is undefined.$var //= 30;
See perlop for more information.
Hope this helps!
In reply to Re: Need clean code
by 1nickt
in thread Need clean code
by ravi45722
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |