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. joe.smith@comcast.com
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('joe.smith@example.com')"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('read_rfc822.@docomo.ne.jp')"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.
Smylers
|
|---|