in reply to Re: Audrey Fong
in thread Need help with regexes to validate user input

3. credit card number should only contain 16 characters

if ($creditcard =~ /^\d{16}$/) ...

Assume no space in the credit card number. Otherwise a simple check to strip out the space.

Actually, for CC validation, use Buisness::CreditCard. A CC num isn't necessiarily 16 digits (it changes between companies), the first few digits identify the company, and the last digit is a checksum. Buisness::CreditCard will look at all these things for you.

----
I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
-- Schemer

: () { :|:& };:

Note: All code is untested, unless otherwise stated