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


In reply to Re^2: Yet Another E-mail Validation Question by Smylers
in thread Yet Another E-mail Validation Question by tanger

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.