Grab the experimental.pm module from CPAN (or you may already have it if you have a recent version of Perl installed).
Then, at the top of each file add:
use experimental 'switch';
Then continue to use given/when under every version of Perl that supports it...without annoying warnings or meta-warnings.
In reply to Re: Best option for "switch/case" functionality?
by TheDamian
in thread Best option for "switch/case" functionality?
by cheselton
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |