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.


Le ven. 21 déc. 2018 à 00:45, ToddAndMargo via perl6-users <
perl6-users@perl.org> a écrit :

> On 12/20/18 2:59 PM, Laurent Rosenfeld via perl6-users wrote:
> > $0 /does /work with "perl6 -e" if you use correctly the tilde ~
> > operator. For example:
> >
> > $ perl6 -e ' "abc" ~~ /.(\w)./; say ~$0;'
> > b
> >
>
> This is because "say" is also a converter.  My issue
> is when assigning to another variable that has been
> "typed".
>

Reply via email to