=over 4
-=item o
+=item *
a subroutine or method call
-=item o
+=item *
a regular expression match, i.e. C</REGEX/> or C<$foo =~ /REGEX/>,
or a negated regular expression match C<$foo !~ /REGEX/>.
-=item o
+=item *
a comparison such as C<$_ E<lt> 10> or C<$x eq "abc">
(or of course C<$_ ~~ $c>)
-=item o
+=item *
C<defined(...)>, C<exists(...)>, or C<eof(...)>
-=item o
+=item *
A negated expression C<!(...)> or C<not (...)>, or a logical
exclusive-or C<(...) xor (...)>.
given($foo) {
when (/x/) { say '$foo contains an x'; continue }
when (/y/) { say '$foo contains a y' }
- default { say '$foo contains neither an x nor a y' }
+ default { say '$foo does not contain a y' }
}
=head3 Switching in a loop
Any Code[+] scalar sub truth $b->($a)
Hash Hash hash keys identical [sort keys %$a]~~[sort keys %$b]
- Hash Array hash slice existence grep {exists $a->{$_}} @$b
+ Hash Array hash slice existence @$b == grep {exists $a->{$_}} @$b
Hash Regex hash key grep grep /$b/, keys %$a
Hash Any hash entry existence exists $a->{$b}