P is for Practical | |
PerlMonks |
Re: Argument "" Isn't numeric in numeric eq (==)by Kenosis (Priest) |
on Feb 09, 2014 at 20:31 UTC ( [id://1074161]=note: print w/replies, xml ) | Need Help?? |
Consider using a regex that captures sets of two digits (or 'empties') separated by a comma, as tuples:
Output:
And then testing for '1,1' and '1,2' in each line:
Output:
BTW - You were off by one in all of your array indices. You had:
when you meant:
Hope this helps! Edit: Updated to reflect the '1,2' "Fail" condition, which I failed to notice. Thank you, Jim.
In Section
Seekers of Perl Wisdom
|
|