This is a sample implementation of summing by just state and then also by city and state.
while ( ... ) { my $last_name = ...; my $address = ...; my $city = ...; my $state = ...; # Aggregate by state $SumStates{ $state }++; # Aggregate by city $SumCityStates{ $state }{ $city }++; } # Print sums for my $state ( keys %SumStates ) { print "$state: $SumStates{ $state }\n"; for my $city ( keys %{ $SumCityStates{ $state } } ) { print " $city: $SumCityStates{ $state }{ $city }\n"; } }
In reply to Re: Creating Reports
by diotalevi
in thread Creating Reports
by George_Smiley
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |