From Switch statements:
Most of the time, when(EXPR) is treated as an implicit smart match of $_, i.e. $_ ~~ EXPR. (See "Smart matching in detail" for more information on smart matching.) But when EXPR is one of the below exceptional cases, it is used directly as a boolean:
- a subroutine or method call
is true, when ( $re->m1 )
UPDATE: I just noticed that the elided list is followed by
In those cases the value of EXPR is used directly as a boolean.
… in case you didn't believe it the first time, I guess. :-)