If local() doesn't work that way, why does this example localize every time through the block?

What? When did I start disagreeing on how local() works? I even said "Otherwise you'd do the thing [= local()ization] on each iteration of the block". The whole point of doing the local()ization outside the block is to circumvent the relocal()ization -- because you don't want the relocal()ization. With the relocal()ization it wouldn't be equivalent to what perl does with the regex-variables. Again, I'm trying to manually do what Perl does for you.

There seems to be a lot of confusion here. It all started with me stating how I'd interpret how perl works in pure-Perl. That was because if you know Perl you also understand the behaviour you can deduce from the code. So if you saw a "picture" of how it works it could help you (and other reading this) to remember the behaviour.

I know that the regex-variables are highly magical and I don't really understand how they work internally myself. My interpretation comes from the documentation, and I can't recall me having any other interpretation of it. I've always pictured me the regex-variables working something like what I wrote above, and it seems like it works alright. I haven't found any occation where my picture gives the wrong results -- but I haven't look so I don't claim it to be perfect.

-Anomo

In reply to Re: Re(6): Regex Capturing: Is this a bug or a feature? by Anonymous Monk
in thread Regex Capturing: Is this a bug or a feature? by shotgunefx

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.