Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: hash reference to itself

by dave_the_m (Monsignor)
on Aug 02, 2016 at 17:41 UTC ( [id://1169022]=note: print w/replies, xml ) Need Help??


in reply to hash reference to itself

Note that a self-referential hash will leak. This code consumes several Gb after running for a few seconds:
while (1) { my %h; $h{a} = \%h; }

You may need to use weaken() from Scalar::Util

Dave.

Replies are listed 'Best First'.
Re^2: hash reference to itself
by ExReg (Priest) on Aug 02, 2016 at 18:15 UTC

    Good to know. Thanks!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2024-03-29 15:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found