where$PAT = '$X =~ s{^(.*?)Resolved (\d+) problems out of (\d+) picked(.*?) +$}{ (($3-$2)/$3>.5) ? 1 : 0 }se';
When I do an eval($PAT); $X correctly gets modified to 1 or 0 depending on the digits in the string. But there is also a newline character appended to the '0' or '1'. What am I doing wrong here. I thought using 's' would let the (.*?) at the beginning and end glob all the newline characters.$X = "Line1\nLine2Resolved 200 problems out of 5000 picked\nLine4\nLin +e5";
Thanks for your help
In reply to newline behavior in Regular Expression by asinghvi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |