Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Re: undefining hashes to free memory

by Anonymous Monk
on Mar 15, 2004 at 21:38 UTC ( [id://336843]=note: print w/replies, xml ) Need Help??


in reply to Re: undefining hashes to free memory
in thread undefining hashes to free memory

How could I possibly reuse it? The hash has gone out of scope, there are no external references to the hash or it's elements; I don't see any way of addressing any of it later.
  • Comment on Re: Re: undefining hashes to free memory

Replies are listed 'Best First'.
Re: Re: Re: undefining hashes to free memory
by perrin (Chancellor) on Mar 15, 2004 at 21:52 UTC
    If you run the same sub again, which uses the same lexical again, perl reuse the same memory for it.
      Okay, I understand what you are saying now, but this doesn't seem like a very good thing, especially in an anonymous block (which isn't what I'm using in the actual program but it's still not very smart).
        It is very much not a good thing, especially when Perl forgets to reinitialize that memory as happens with the infamous my $foo if cond(); bug when the condition is false.

        <gripe>Which would have triggered a warning in Perl 5.10, but p5p in its infinite wisdom decided that there would be too many real bugs reported, and therefore will only report a warning in the case where the author probably intended the odd behaviour.</gripe>

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2024-04-16 07:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found