But I think that could be cleaned up more by using less singular variables. As for the for loop you're trying to use perl6 style number comparisons and the comparisons don't seem to match the age bracket. Maybe you mean something like thisif(not defined $institution) { $institution_table{ unaffiliated }++; } else { $institution_table{ $_ }++ for grep { $institution eq $_ } ( $hospital1 $hospital2 ); }
And the sort() is superfluous in the for loop (well at least from the code provided). Probably the best way to simplify your is to simplify your data structures (as one follows the other). </code>$institution_table{$_}->{"fortyfive_fifty"} ++ if 45 > $age and $age <= 50;
_________
broquaint
In reply to Re: an easier way with grep, map, and/or sort?
by broquaint
in thread an easier way with grep, map, and/or sort?
by aufrank
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |