in reply to Global %+ woes

Can I copy all the keys found in the funny tied %+
Yes: my %whatever = %+;
would that be slow?
Slow is a relative term. Did you try? Did you benchmark it? Do you really think the speed of copying %+ matters when compared to running the regexp engine?
I read a mention in passing that %+ and %- are both tied views to the same underlying object. So, can I just grab that object and swap it with a blank one, so now it's mine to keep and a subsequent regex won't clobber it?
Have you looked at Tie::Hash::NamedCapture?

Replies are listed 'Best First'.
Re^2: Global %+ woes
by John M. Dlugosz (Monsignor) on Apr 27, 2011 at 11:16 UTC
    Have you looked at Tie::Hash::NamedCapture?
    Yes, I have. It's a stub with one trivial function. The magic lives in XS and in the Regex core somewhere.