#!/usr/bin/perl chomp ($_ = ); @x = split; foreach $x (@x){$x{$x} += 1} foreach $x (sort keys %x){print "$x: $x{$x}\n"}