Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^3: %+ and cloning

by BrowserUk (Pope)
on Jan 11, 2010 at 13:04 UTC ( #816716=note: print w/ replies, xml ) Need Help??


in reply to Re^2: %+ and cloning
in thread %+ and cloning

A simple my %copy = %+; is equivalent to your sub. However, that may not be enough!

According to the docs for Tie::Hash::NamedCapture, the values of the tied hash can contain an array reference holding multiple captures due to the re-use of the same named capture. In which case you might need to use something more complex to perform a deep copy operation.

That said, in my simple tests, this doesn't seem to apply to %+. It does apply to %- though.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.


Comment on Re^3: %+ and cloning
Select or Download Code
Replies are listed 'Best First'.
Re^4: %+ and cloning
by JavaFan (Canon) on Jan 11, 2010 at 16:39 UTC
    It happens if the tie happens with parameters all => 1, but %+ is tied without them. So even if your tests were less simple, you shouldn't have seen it with %+ (and if you ever do, there's a bug).

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (15)
As of 2015-07-30 17:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (273 votes), past polls