为什么这里substr-rw
会切断尾随的6
?
#!/usr/bin/env perl6
use v6;
my $str = '123';
$str ~= '.' x 30;
$str ~= '456';
say $str; # 123..............................456
$str.substr-rw( 0, 10 ) = '';
say $str; # ........................45
perl6 --version
This is Rakudo version 2016.03-38-g8df1a69 built on MoarVM version 2016.03-46-g50c7f6a implementing Perl 6.c.
答案 0 :(得分:5)