ext_78: A picture of a plush animal. It looks a bit like a cross between a duck and a platypus. (Default)
Philip Newton (LJ OpenID) ([identity profile] pne.livejournal.com) wrote in [site community profile] changelog 2009-03-06 10:30 am (UTC)

Wouldn't it be better to use a regex to match the code?

Something like DIGIT_REGEX = qr/^[ABCDEFGHJKLMNPQRSTUVWXYZ23456789]+$/?

Then you'd only have one "regex match" Perl op rather than a foreach loop with hash lookups for each character, which should be faster.

Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org