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 ( #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? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (1)
As of 2023-09-28 01:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?