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