in reply to perl6 match variable

Fwiw this seems to be bug #118705.

Replies are listed 'Best First'.
Re^2: perl6 match variable
by jeckyhl (Novice) on Nov 23, 2015 at 09:48 UTC
    Issue #118705 is marked as resolved but the problem is still there ??
    for 1 { say "foo".subst: /(foo)/, {$/[0] ~ "o"}; } #gives # Use of Nil in string context in block at <unknown file>:1 # o
    tested with perl6 version 2015.11-1-ge88196a built on MoarVM version 2015.11
      Bug 118705 talked about a similar looking set of bugs with the `s///` construct. This construct is a variant of, but not identical to, the `subst` function. It looks like a similar fix will have to be applied separately for `subst`. I've just filed a new `subst` specific bug report.

      Afaict the bug is omission of an automatically added `-> $/` signature. One workaround is to manually add the missing piece:

      for 1 { say "foo".subst: /(foo)/, -> $/ {$/[0] ~ "o"}; }

Re^2: perl6 match variable
by jeckyhl (Novice) on Sep 18, 2014 at 13:08 UTC
    Interesting, this would confirms that this is a bug and not a subtle spec interpretation issue