use feature qw(say switch); given($var) { when (['yes','no']) { say "You chose $var"; } default { say "you chose something other than yes or no"; } }