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:Since $re->m1 is true, when ( $re->m1 ) succeeds.
- a subroutine or method call
…
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. :-)
In reply to Re: given-when with compiled regular expression returned from method confusing behavior
by JadeNB
in thread given-when with compiled regular expression returned from method confusing behavior
by whakka
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |