in reply to (dkubb) Re: (4) YAL10CI (Yet Another LUHN-10 Checksum Implementation)
in thread YAL10CI (Yet Another LUHN-10 Checksum Implementation)
Running this under -w gives warnings on odd lengths for $number. You can shut them up with only a little slowdown with the following:
sub dkubb_LUHN10_2 { my $number = shift || return 0; my $sum; $sum += (chop($number) || 0) + $LUHN10_map[chop($number) || 0] while "$number"; ($sum % 10 == 0) || 0; }
|
|---|