
aniket
New User
Dec 10, 2009, 6:17 AM
Post #1 of 3
(8616 views)
|
can any one tell how to validate correct email address using perl script
|
Can't Post
|
|
Can any one tell how to Write a program in perl with the following aim: - takes an email address as input - outputs a "valid" or "invalid" - valid if the email address is valid, and invalid if it is invalid. - make your own assumptions about what is a valid email addres and what is invalid. I tried below stuff but didnt worked..please help me: #!/usr/bin/perl -w print ("Please type yor email id:\n"); $email = <STDIN>; if ($email =~ /^(\w\-\_\.)+\@((\w\-\_)+\.)+[a-zA-Z]{2,}$/) { print ("$email is valid"); } else { print ("$email is invalid"); } Please help me.
(This post was edited by aniket on Dec 10, 2009, 6:37 AM)
|