Perl: the Markov chain saw | |
PerlMonks |
RESOLVED - Autovivification: How Did I End Up With a Larger Number of Hash Keys Here?by perldigious (Priest) |
on Mar 03, 2020 at 17:59 UTC ( [id://11113721]=perlquestion: print w/replies, xml ) | Need Help?? |
perldigious has asked for the wisdom of the Perl Monks concerning the following question: Okay, this just has to be my brain missing something, and it's driving me crazy. All the following code should be doing is deleting hash keys, not adding them, yes?
And yet, based on my data set the first print scalar(keys %auto_picks) returns a little over 100k, and the second more than twice that. Fellow Monks, I implore you, what is the cause of my stupid here? ---------- RESOLVED: Autovivification was my problem and turning it off via the autovivification module was my solution. Thanks to those that pointed out this was my problem.
Just another Perl hooker - My clients appreciate that I keep my code clean but my comments dirty.
Back to
Seekers of Perl Wisdom
|
|