You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<lucasb> m: my $x = 'a1'; $x ~~ s/(\d+)/<$0>/; say $x
<camelia> rakudo-moar 58a5ed: OUTPUT«a<1>»
<lucasb> m: for 1 { my $x = 'a1'; $x ~~ s/(\d+)/<$0>/; say $x }
<camelia> rakudo-moar 58a5ed: OUTPUT«Use of Nil in string context in
code at /tmp/SOTPBUyxHF:1a<>»
* masak submits rakudobug
<masak> lucasb: clearly that should work. thanks for finding it.
<masak> m: my $s = "OH 819"; $s ~~ s:g/(\d)/{chr(64 + $0)}/; say $s
<camelia> rakudo-moar 58a5ed: OUTPUT«OH HAI»
<masak> m: my $s = "OH 819"; for $s { s:g/(\d)/{chr(64 + $0)}/; .say }
<camelia> rakudo-moar 58a5ed: OUTPUT«Use of Nil in numeric context in
block at /tmp/4I0l1xSFeV:1Use of Nil in numeric context in block
at /tmp/4I0l1xSFeV:1Use of Nil in numeric context in block at
/tmp/4I0l1xSFeV:1OH @@@»
So, two cases of the same code, with and without a surrounding for
loop block. All these match, but in the presence of the for loop, $/
is Nil instead of the appropriate match object.
Migrated from rt.perl.org#125598 (status was 'resolved')
Searchable as RT125598$
The text was updated successfully, but these errors were encountered: