in reply to Re: Storing unique values
in thread Storing unique values

if (exists($hash->{$cur})) { $hash->{$cur}++; } else { $hash->{$cur} = 1; }
No need to jump through hoops. Perl doesn't complain when increasing undefined variables, so this will do:
$hash->{$cur}++;
It's the accept practice for this case, in fact, so it should be done this way as well.

Makeshifts last the longest.