in reply to Re: Luhn Number Golf
in thread Luhn Number Golf
++.
You can eliminate reverse and shorten it to 55.
and, if you don't care for strict-ness, shave another 5 chars, by eliminating my$s;sub luhn { # 1 2 3 4 5 #234567890123456789012345678901234567890123456789012345 my$s;$_=pop;~s/(.)(.)/$2.$1*2/ge;$s+=$_ for/./g;!chop$s }
/prakash
In Section
Meditations