in reply to Looping structure
can be written as -my $value = $list{$location}; $value++; $list{$location} = $value;
And your entire code block can be simplified to just one line of Perl (assuming your $location is never '0') -$list{$location}++;
$list{ $location || 'Unknown' }++;
|
|---|