Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Re^4: calculate average from range of hash values (optimize)by Aristotle (Chancellor) |
on Jul 27, 2003 at 18:32 UTC ( [id://278252]=note: print w/replies, xml ) | Need Help?? |
For the record your second solution corrupts the hash with keys whose value is undef.Eh? Extraordinarily strange. So a slice lookup autovivifies elements, while a single-element lookup doesn't. Feels like a bug, if you ask me.. certainly counterintuitive. Easy enough to fix, though.
Makeshifts last the longest.
In Section
Seekers of Perl Wisdom
|
|