human.pl: print map{$$_[0]}sort{$$b[1]!~/\D/<=>$$a[1]!~/\D/||(grep$_,map{$,=$$a[$_];$_>@$b ||($,!~/\D/&&length$,<=>length$$b[$_])||$,cmp$$b[$_]}1..@$a)[0]}sort{@$b<=>@$a} map{[$_,split/(\d+|\n)/,lc]}<> This passes, but doesn't look right. It does cut 15 strokes, though: print map{$$_[0]}sort{$$b[1]!~/\D/<=>$$a[1]!~/\D/||(grep$_,map{$,=$$a[$_];$_>@$b ||($,!~/\D/&&length$,<=>length$$b[$_])||$,cmp$$b[$_]}1..@$a)[0]}map{[$_,split/(\ d+|\n)/,lc]}<> shuffle.pl: print map{splice@x,rand@x,1}@x=<> select.pl: @x=<>;print map{splice@x,rand@x,1}0,1