It looks clean to me.
uniq could be replaced with a hash if you don't care about order, but one could argue that would make it less clean.
for my $location (@locations) { next if $location eq 'HEADING'; my ($country, $state, $city) = split /,/, $location; ++$countries{$country}; ++$states{$state}; ++$cities{$city}; } @countries = keys %countries; @states = keys %states; @cities = keys %cities;
In reply to Re: cleaner code ....
by ikegami
in thread cleaner code ....
by tdevil76
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |