>perl -wMstrict -lE "for my $s qw(a b c d) { given ($s) { when ('a') { say 'a'; continue; } when ('b') { say 'b'; continue; } when (/[ab]/) { say ' after a or b'; } say 'neither a nor b'; when ('d') { say 'd'; } default { say qq{other: '$_'}; } } } " a after a or b b after a or b neither a nor b other: 'c' neither a nor b d