I'm curious, why did you use delete instead of overwriting the hash ref?
This:
delete @{$self->{'hash'}}{ keys %{$self->{'hash'}} };
must be less efficient than this:
$self->{hash}={};
Are you worried about someone else having a reference to the same hash?
--
Mike | [reply] [d/l] [select] |
Heh, even brand new code has cruft. That was a leftover which had been the last line, providing the list of values to return. I decided that was no good without keeping their order, but the delete line never got changed. Thanks!
The line in question, #38 in the clear method, is replaced with RMGir's suggested one. That makes the hash values no longer significant, so assignments to them have been changed to a ++ bump. $VERSION incremented and RMGir credited.
After Compline, Zaxo
| [reply] |