http://qs321.pair.com?node_id=147740


in reply to Re: Luhn Number Golf
in thread Luhn Number Golf

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

/prakash