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
[
From perlop, Quote and Quote-Like operators [bits in brackets added by me]:
/PATTERN/msixpodualgc
Searches a string for a pattern match, and in scalar context returns true [1] if it succeeds, false [undef] if it fails.
(Looking at the section on s///
will also be useful ;-)
Perl just doesn't have a discreet boolean type or true
/false
aliases so 1
and undef
are often used: however, it could very well could be other values without making the documentation incorrect.
$1
will never be defined because there is no capture group: perhaps $& (aka $MATCH) is desired? (Or better, change the regular expression to have a capture group ;-)
Happy coding.