If you don't specify it on the m//, s/// or qr// that builds a regexp, ^ and $ will act as if you didn't specify it. Absence of "m" does not mean "inherit". For that reason, qr// without "m" turns off the option for the regexp it builds.
>perl -le"print qr/foo/"
(?-xism:foo)
>perl -le"print qr/foo/m"
(?m-xis:foo)
Until very recently, there was a bug that caused (?-m:...) to be ignored in some circumstances.
>perl588 -le"$re=qr/a$/; print $re; print qq{a\nb\n}=~/$re/m ?1:0"
(?-xism:foo$)
1
>perl5100 -le"$re=qr/a$/; print $re; print qq{a\nb\n}=~/$re/m ?1:0"
(?-xism:foo$)
0
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.