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
In reply to Re: Getting rid of duplicates
by terra incognita
in thread Getting rid of duplicates
by New Novice
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |