in reply to Re^6: Quick 'Quote' DBI Question
in thread Quick 'Quote' DBI Question

Sweet! I have it where SSN can be numbers only by doing something like:
if ($ssn =~ /^[0-9]*\z/ && $year =~ /^[0-9]*\z/) {

Replies are listed 'Best First'.
Re^8: Quick 'Quote' DBI Question
by ww (Archbishop) on Apr 06, 2007 at 15:16 UTC
    ooops. update The "oops" is on me, that is. Missed that there are supposed to be only four digits.

    That leaves you needing a small fix to your regex to deal with cases when the SSN is entered with hyphens, as

    123-45-6789

    However, you might still want to make sure that's the case, by using a numeric quantifier instead of the deathstar

    s/if ($ssn =~ /^[0-9]*\z/if ($ssn =~ /^[0-9]{4}\z/
      Not a problem, is the last four digits only.