[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
RE: Email parsing (Repost)
****** message to minivend-users from Ryan Hertz <rhertz@gyb.baits.com> ******
I've added use Email::Valid; to the top of lib/Vend/Order.pm after
retrieving the module and its required components from www.cpan.org -- and
of course, after backing up Order.pm.
Changed From line 708- of lib/Vend/Order.pm:
sub _email {
my($ref, $var, $val) = @_;
$addr = Email::Valid->address($val);
if($addr) {
$CGI::values{email} = $addr;
return (1, $var, '');
}
else {
return (undef, $var, "$val not an email address");
}
}
And I think it works, that is, will reject addresses that contain spaces,
or funny characters, etc. Email::Valid will even, if requested, verify
that the domain is real. However, it will still let customers enter their
email addresses like websites (ex: www.rhertz@gyb.baits.com), 100% of those
email addresses fail. I could just add a little note below the email field
in the order form touting proper syntax of an email address; but that might
be too easy. Besides, someone has got to educate those people of their
errs or they will never get email.
I'm going to go pick apart Email::Valid now. :-)
Ryan Hertz tel 520-645-3812
Webmaster tel 800-645-BAIT
Advertising Director fax 520-645-2588
Gary Yamamoto Custom Baits, Inc. http://www.yamamoto.baits.com
-
To unsubscribe from the list, DO NOT REPLY to this message. Instead, send
email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
Archive of past messages: http://www.minivend.com/minivend/minivend-list