![]() |
|
Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re^3: array of arraysby kevbot (Priest) |
on Jun 13, 2017 at 05:33 UTC ( #1192655=note: print w/replies, xml ) | Need Help?? |
Hello virtualweb,
My solution did not use an array. The contents of $data{$key} are a single scalar value (the running total of values for the given key). So, my code is not keeping track of how many data entries that are encountered for a given value of $key. Here is a modified version of my code that will print out the information you request. Note, I'm still not using arrays. In this code, $data{$key} contains a hash reference with keys size and total. The value of size is the current number of elements found for the given $key. The value of total is the current total of values that have been encountered for the given $key.
In Section
Seekers of Perl Wisdom
|
|