[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Perl Question



I have a perl script with a line

  &sorry('be') unless ($form{'EMAIL'} =~ /.+\@.+/);

I know that this appears to be unsafe... as a matter of fact, something like
mad((@foo.bar is a valid address as well as a@b

I've tried coming up with a line to check for sane email addresses but it
doesn't appear to do anything different than the above. Have any input on
what might be wrong with the one below, or how to fix the one above?  Trying
to limit to alphanumeric (including _ ) as well as . and -


(everything below is one line please disregard any breaks)

&sorry('be') unless ($form{'EMAIL'} =~ /[\w\.-]+\@[\w\.-]+\.[\w\.-]+/);
-
To unsubscribe, send email to majordomo@silug.org with
"unsubscribe silug-discuss" in the body.