The argument-less lambda block
{ ... }
is shorthand for
-> $_ { ... }
and $/ gets passed as argument to that.
You could use
-> $match { ... }
instead to access $/ as $match
The match object $/ in not visible on its own because subst evaluates the regex in a different scope.
In reply to Re: perl6 match variable
by Anonymous Monk
in thread perl6 match variable
by jeckyhl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |