Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re^2: Strange behavior of @- and @+ in perl5.10 regexpsby demerphq (Chancellor) |
on Sep 13, 2009 at 13:08 UTC ( [id://794990]=note: print w/replies, xml ) | Need Help?? |
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
In Section
Seekers of Perl Wisdom
|
|