Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: re-useing a hash

by isotope (Deacon)
on Apr 20, 2005 at 15:53 UTC ( [id://449643]=note: print w/replies, xml ) Need Help??


in reply to re-useing a hash

  1. Localize the hash to your foreach loop (%hash = (); becomes my %hash;).
  2. Remove the reference to your hash from sub gather completely.
  3. Increment your hash counter like this instead: $hash{$rule}++;


--isotope

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2024-04-18 06:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found