Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^2: Strange behavior of @- and @+ in perl5.10 regexps

by demerphq (Chancellor)
on Sep 13, 2009 at 13:08 UTC ( [id://794990]=note: print w/replies, xml ) Need Help??


in reply to Re: Strange behavior of @- and @+ in perl5.10 regexps
in thread Strange behavior of @- and @+ in perl5.10 regexps

Hmm, probably not documented directly and might not be tested explicitly. But certainly indirectly. We have lots of tests that $1 and friends behave "as expected" inside of (?{ ... }) and (??{ ... }) blocks. So effectively that means that @- and @+ have to as well, as they are all just ties into the same C level data structures.

Now, at a certain level these constructs are still documented as experimental or subject to change so technically you have a point, and I appreciate that you pointed this out.

But I personally would/do see problems with the magic variables inside of these constructs as a bugs, the experimental status just says I get to change my mind if I want. :-) However in this case things are working pretty much exactly as planned, with the possible nit as to whether (?<expr> ... ) should have a slot allocated to it that never gets used. Which is mostly irritating as it is wasteful, and a little counter-intuitive, but actually expected behaviour.

---
$world=~s/war/peace/g

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://794990]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2024-03-19 05:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found