How about ...
my %counter; $counter{$_}++ while (<DATA>); print sort {$counter{$b} <=> $counter{$a}} keys %counter; __DATA__ 1 info 1 info 1 info 2 info 3 info 3 info 4 info 4 info 4 info 4 info
This increments a counter for each of the lines. Then sorts them in reverse count order.
Maybe this is close to what you want. Let us know if it needs any changes.
--
Steve Marvell
In reply to Re: wisdom needed
by marvell
in thread wisdom needed: sorting an array
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |