sub mycmp { length($b) <=> length($a) } sort mycmp @list;