Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^2: clear perl hash variable

by massa (Hermit)
on Mar 04, 2009 at 14:36 UTC ( [id://748172]=note: print w/replies, xml ) Need Help??


in reply to Re: clear perl hash variable
in thread clear perl hash variable

And, anyway, %hash = {} does not do what himanshu.padmanabhi think it does. To clear a hash in perl, we do:
%hash = ()
or
undef %hash
or, if $hash is a hash reference,
%$hash = ()
or, somewhat similarly but not exactly the same,
$hash = {}
or, also somewhat similarly but not exactly the same,
undef $hash
[]s, HTH, Massa (κς,πμ,πλ)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (8)
As of 2024-03-28 09:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found