Perl perlsyn
"Another useful shortcut is that, if you use a literal array or hash as the argument to given , it is turned into a reference. So given(@foo) is the same as given(\@foo) , for example."
Therefore, just use an array reference like already suggested by toolic:
when ([qw(jpeg jpg png)]) {
Or use a regex
when (/^(?:jpeg|jpg|png)$/) {
In reply to Re: Smart-search/When question
by wind
in thread Smart-search/When question
by John M. Dlugosz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |