in reply to perl6 match variable
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: perl6 match variable
by jeckyhl (Novice) on Sep 09, 2014 at 21:30 UTC | |
|
Re^2: perl6 match variable
by grondilu (Friar) on Sep 10, 2014 at 09:56 UTC | |
by jeckyhl (Novice) on Sep 10, 2014 at 21:32 UTC |