Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: hash reference to itself

by dave_the_m (Monsignor)
on Aug 02, 2016 at 17:41 UTC ( #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? | Other CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2021-11-29 05:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?