AFAIK you will need either the /m or /s operator - otherwise your regex will only ever look at a single line.
No, that's not true, see below one-liner.
perl -e '$t="hello\nmoto";print "yep\n" if $t=~m/hello\smoto/;'All the s modifier does is to change dot (.) to match newline characters and all the m modifier does is to make ^ and $ match at the beginning/end of each line instead of the whole string. See perldoc perlre.
In reply to Re^2: //s modifier
by tirwhan
in thread //s modifier
by kettle
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |