That is exactly what I'm saying. The fact that a qr// regex stringifies with a (?-xism:$re) wrapper doesn't mean to me that it is actually core to it. The regex itself is hard coded into some nodes which actually indicate which of 'ism' apply and its that that you're saying should remain static and I'm saying should bend. Now please keep in mind that I've moderated my stance a bit and I only think /i is acceptable to have this behaviour for. The other three flags 'x', 's' and 'm' have more significant meaning and I can't bring myself to think of a situation where it would make sense to override any of those.

So really, what I'm saying is that if you had previously said $test = qr/test/ and later said /$test FOO!/i that the /i-ness of the $test object would be overridden and that if you wanted to keep that you'd have to said /(?i:$test) FOO!/i. I had originally written $test = "test" then all of this would behave exactly as I'm suggesting. (except that 'xms' wouldn't be specified either).


In reply to Re: Re: Re: Re: Re: Re: Re: Re: Risks in the oblivious use of qr// by diotalevi
in thread Risks in the oblivious use of qr// by gmax

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.