O que eu faria:
#!/usr/bin/perl
use strict;
my %h;
while (<>) {
$h{$_}++ for split /\s+/;
END{
for (sort { $h{$b} <=> $h{$a} } keys %h){
print $_, "=", $h{$_};
print "\n";
}
}
}
então:
./script input_file