#!/usr/bin/perl while(<>){ chomp; map{$h{$_}++}split/ /;} map{print"$_:$h{$_}\n"}sort keys %h;
aaa bbb ccc ddd eee fff fff aaa eee eee kkk lll eee lll bbb ooo ppp qqq
aaa:2 bbb:2 ccc:1 ddd:1 eee:4 fff:2 kkk:1 lll:2 ooo:1 ppp:1 qqq:1
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!