http://www.perlmonks.org?node_id=89143


in reply to (Golf) Kaprekar's Process

Here's mine at 55.

cheers

tachyon

sub a { ++$a;$_=join"",sort pop=~/./g;$_!=459?a(-$_+reverse):$a }

Shave 1 for 54, and I'm out

sub a { ++$a;($_=join"",sort pop=~/./g)!=459?a(-$_+reverse):$a }