Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Re: Yet Another Email Validation question

by gryphon (Abbot)
on Apr 06, 2004 at 15:48 UTC ( #342980=note: print w/replies, xml ) Need Help??

in reply to Yet Another Email Validation question

Greetings sweetblood,

Check out Email::Valid. I'm a big fan of letting someone else do my work for me, and the module looks fast.

use Email::Valid; my $valid_email = (Email::Valid->address($unverified_email)) ? $unverified_email : undef;

code('Perl') || die;

20040408 Edit by BazB: Changed title from 'Re: yare for email address'

Replies are listed 'Best First'.
Re: Re: Yet Another Email Validation question
by sweetblood (Prior) on Apr 06, 2004 at 15:57 UTC
    Yes, this looks good. My only problem is I won't be able to get it installed for quite awhile as the company has to do a review prior to installing any modules. This is a lengthy process. This is why I'm opting for a regex method.


      The company has to review any newly installed module? Sensible. But what about your code, doesn't that have to be reviewed? What if you just make Email::Valid part of your application? Or just copy and paste the relevant code? How long did your company take to review perl itself?

      Anyway, your regex is just too trivial to take serious. It would fail on every email address I create for registrating at a website. Rejecting email addresses that don't start with a \w character is as useful as rejecting street names that don't start with a vowel. You're rejecting perfectly valid email addresses, and on the other hand, you are accepting anything that starts with a \w character, and contains a @ and a dot. Which would mean you'd accept the text of this posting as a valid address, yet reject "this is valid"


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://342980]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2020-11-30 05:48 GMT
Find Nodes?
    Voting Booth?

    No recent polls found