as:if (defined($value) && exists($switch{$value})) { $switch{$value}->(); } else { $switch{'default'}->(); # I assume $pages was a mistake }
($switch{$value} || $switch{'default'})->();
Liz
In reply to Re: Re: Simple Switch statement
by liz
in thread Simple Switch statement
by knexus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |