perl -lpe '$_=(sort{$b<=>$a}map{length}<>)[0]' < foo