模式测试程序

#/usr/bin/perl
use 5.010;

while(<>){
    chomp;
    if (/YOUR_PATTERN_GOES_HERE/) {
        say "${^PREMATCH}|${^MATCH}|${^POSTMATCH}";
     } else {
         say "No match:   |$_|
";
     }

}
原文地址:https://www.cnblogs.com/tjxwg/p/3318716.html