使用 use re debug 查看正则表达式的匹配过程

608 查看

复制代码 代码如下:

#!/usr/bin/perl
use strict;
use warnings;
use re 'debug';
sub test {
    my $str = "123456789";
    print join(":", split /(?<=...)/, $str);
}
test();