#!/usr/bin/perl -w while(<>){$x{uc$_}++for(/[a-zA-Z]/g)};print sort{$x{$b}<=>$x{$a}}keys%x # 71-stroke solution to https://codegolf.stackexchange.com/questions/32757/etaoin-shrdlu-golf # except it also doesn’t handle missing letters correctly. # The 54-stroke solution on the page is # s/./$h{uc$&}++/egfor<>;print sort{$h{$b}<=>$h{$a}}A..Z # which handles the missing letters problem and handles dropping # nonalphabetics in one step!