Hi Marshall:
Thanx for this solution.. I was going from bottom to top analyzing all suggestions and that's why in your next solution I asked for what you coded here. (I didn't see it till now).
I wonder if you can help me print the size of each anonymous array ($count) and all the results (number, sub total and grand total) in one line inside the while loop something like this:
my $e = '0'; while (my $line = <DATA>) { $e++; my ($bucket, $num) = $line =~ m/^\s*(\d+)\s*\|\s*(\d+)/; push @{$HoA{$bucket}},$num; my $grand_total += $num; ## Sub Total = the running total per line up to 150, 75 and 55.? my $sub_total = "????"; ## the size of each anonymous array ## @Count[$bucket] += $num; ## I know this is super wrong ## print"Row $e / Number Array ($bucket) / Num ($num) / Array Size ($C +ount[$bucket])/ Sub Total ($sub_total) / Grand_Total ($grand_total)/n +"; }
Thanx beforehand
In reply to Re^2: array of arrays
by Anonymous Monk
in thread array of arrays
by virtualweb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |