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 reply to Re: Re: Luhn Number Golf
by PrakashK
in thread Luhn Number Golf
by Cody Pendant
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |