in reply to Getting rid of duplicates

Another one using a hash, this is a modified character frequency example from perlretut. This will sort and also handle negative numbers. Comments on where I can improve this code and what practices I should stay away from are appreciated.
use strict; local $/; my $f = <DATA>; my %chars; $f =~ s/(.+)/$chars{$1}++;$1/eg; # final $1 replaces char with itself print "'$_'\n" foreach (sort {$a <=> $b} keys %chars); __DATA__ 1 1 2 2 3 3 4 5 6 7 8 9 10 11 12 13 -12 -3