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


in reply to Luhn Number Golf

Here's a sub with 62 characters. Expects the number as an argument and returns 1 or 0.

sub luhn { #2345678901234567890123456789012345678901234567890123456789012 for(pop=~/(.)(.)/g){($a+=$1)+=$_ for map{split//}2*$2}!($a%10) }
/prakash