given( $x ){ when ([2..5]) { ...; } when ([6..10]) { ...; } default { ...; } }
Bear in mind that as of Perl 5.18, given/when has been marked experimental (and issues warnings) because it may undergo major changes in a future version of Perl.
In reply to Re: range comparison in given
by tobyink
in thread range comparison in given
by mrguy123
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |