Newbie question - email validation

N

newbie

Sorry if this is oft repeated but I cant find anything in faqs

can someone tell me the simplest (doesnt have to be the cleverest) means
of validating an email address (not MX lookup just the string itself)

thanks

newbie
 
J

Jürgen Exner

Sorry if this is oft repeated but I cant find anything in faqs

can someone tell me the simplest (doesnt have to be the cleverest)
means of validating an email address (not MX lookup just the string
itself)

perldoc -q mail
"How do I check a valid mail address?"

jue
 
R

Ron Bergin

Sorry if this is oft repeated but I cant find anything in faqs

can someone tell me the simplest (doesnt have to be the cleverest) means
of validating an email address (not MX lookup just the string itself)

thanks

newbie

use Email::Valid;

my $validate = Email::Valid->new;
my $address = '(e-mail address removed)';

print $validate->address($address) ? 'yes' : 'no';
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,565
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top