in reply to
Re^2: Populating a hash
in thread Populating a hash
Anytime you have to preface a desired result with "hopefully," you have a wish, not a plan.
Some suggestions for alternate coding are surely forthcoming ... but my suggestion is "benchmark;" don't just hope, know. Fewer lines does emphatically NOT eq "faster" code or "lower cpu utilization." There's so much going on behind the green curtain (cf Wizard of Oz) that benchmarking or intimate familiarity with perlguts (which labels itself only as an "introduction" to the Perl API) and the deeper reaches of Perl wisdom and C will you be able to confidently predict any particular case.
And not just BTW, it's my suspicion that Perl will usually do a better job of optomizing-away bits of my code than I will.