$foo = defined $bar ? bar : $default_for_foo; ## could be written as, but remember, that 0 is false $foo = $bar; $foo ||= $default_for_foo;
____________________________________________________
** The Third rule of perl club is a statement of fact: pod is sexy.
In reply to Re: Effecient shortcut for ?:
by PodMaster
in thread Effecient shortcut for ?:
by traveler
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |