perl -lne '$c{length($_)}++ }{ print qq($_ $c{$_}) for (sort keys %c)'
this is a sample file with several lines of varying length
1 1 2 2 4 3 5 1 6 2 7 2
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!