Perl match only returning “1”. Booleans? Why?

后端 未结 6 889
星月不相逢
星月不相逢 2021-01-18 13:18

This has got to be obvious but I\'m just not seeing it.

I have a documents containing thousands of records just like below:

Row:1 DATA:
[0]37755442
[         


        
6条回答
  •  有刺的猬
    2021-01-18 13:46

    You need to use capturing parentheses to actually capture:

    if ($record =~ /(Defect)/ ) {
        print "$1\n";
    }
    

提交回复
热议问题