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

Re^2: Yet Another E-mail Validation Question

by Smylers (Pilgrim)
on Apr 21, 2005 at 09:11 UTC ( #449901=note: print w/replies, xml ) Need Help??

in reply to Re: Yet Another E-mail Validation Question
in thread Yet Another E-mail Validation Question

Also, I've been hearing a lot about Email::valid on this board, but no one seems to recommend using Email::Valid::Loose.

I suspect that's because most e-mail addresses are genuinely valid, and Email::Valid is fine for most circumstances.

Doesn't it make more sense since it can verify a whole entire range of e-mail addresses?

According to the Email::Valid::Loose docs the kind of invalid addresses it accepts are often used by Japanese telcos for e-mailing mobile phones. They don't seem to be common anywhere else, so I guess most people (especially those not running Japanese-targetted websites) don't worry about this.

I know a few people who have e-mail addresses that containt "." afront of the "@" , ex.

The dot in that address is valid, because there is "smith" between it and the at sign. It's very easy to check that Email::Valid does indeed accept it as valid (and hence that Email::Valid::Loose isn't necessary to allow it through):

$ perl -wMEmail::Valid -le "print scalar Email::Valid->address('')"

Whereas the sample invalid address from the Email::Valid::Loose docs does not validate with Email::Valid:

$ perl -wMEmail::Valid -le "print scalar Email::Valid->address('')"

Apparently Email::Valid::Loose would allow that through, but I've never felt the desire to check: putting a dot directly before the at sign seems completely pointless to me, and since it violates the standard I'm not going out of my way to assist anybody doing this.


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://449901]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (10)
As of 2018-06-25 14:52 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (126 votes). Check out past polls.