|Date:||Wed, 4 Mar 2009 10:45:38 -0700|
|To:||bug-Algorithm-LUHN [...] rt.cpan.org|
|From:||Joseph Bruni <joe.bruni [...] bestwestern.com>|
I believe the documentation for is_valid() is wrong. I don't think you should be appending the calculated check digit to the string prior to calling is_valid(). As written, the example will always succeed regardless of the input. If one is just testing externally supplied numbers (e.g. CC numbers) for validity, it appears that only the CC number needs to be passed to is_valid(). The check digit has already been appended. The check_digit() call would only be useful to create numbers that would pass the is_valid() test. Joe
Message body not shown because it is not plain text.