On 12/21/18 12:58 AM, Laurent Rosenfeld via perl6-users wrote:
You're free to use a Str method call if you prefer, but using the ~ to
stringify $0 and the like works perfectly for me in perl -e ... context.
$ perl6 -e' "abc" ~~ /.(\w)./; put $0.perl; my $c = ~$0; put $c;'
Match.new(list => (), made => Any, pos => 2, hash => Map.new(()), orig
=> "abc", from => 1)
b
If you get a crash using it, I suspect you made another mistake
somewhere. Please provide the exact P6 one-liner giving you a crash.
I did on the 12/20/2018, 2:16 PM post.
$ perl6 -v
This is Rakudo version 2018.11 built on MoarVM version 2018.11
implementing Perl 6.d.
$ p6 'my $x="11.2."; my Str $D0; my Str $D1; $x~~m{ (<:N>+) [.] (\d+) };
$D0 ~$0; $D1 ~ $1; print "$D0 $D1\n";'
WARNINGS for -e:
Useless use of "~" in expression "$D1 ~ $1" in sink context (line 1)
Useless use of "~" in expression "$D0 ~$0" in sink context (line 1)
Use of uninitialized value of type Str in string context.
Methods .^name, .perl, .gist, or .say can be used to stringify it to
something meaningful.
in block <unit> at -e line 1
Use of uninitialized value of type Str in string context.
Methods .^name, .perl, .gist, or .say can be used to stringify it to
something meaningful.
in block <unit> at -e line 1
Use of uninitialized value of type Str in string context.
Methods .^name, .perl, .gist, or .say can be used to stringify it to
something meaningful.
in block <unit> at -e line 1
Use of uninitialized value of type Str in string context.
Methods .^name, .perl, .gist, or .say can be used to stringify it to
something meaningful.
in block <unit> at -e line 1