So should I upload this to CPAN? Did my coworker miss something close to this already on CPAN?

There are a lot of modules on CPAN dealing with e-mail addresses. Unfortunately, a lot of them are rubbish. You might want to take a look at the Perl Email Project if you haven't already.

If I understand you correctly (without specifically having worked through the regexen), you consider the following addresses to be equivalent:

everybody@example.com "Eve" <everybody@example.com> (Rybody) EveRybody+whatever@EXAMPLE.COM
What about addresses with different top-level-domains, but equal second-level-domains? For example emails from/to
foo@gmail.com foo@gmail.net foo@gmail.com.au foo@gmail.at ... foo@gmail.za
are all routed from/to the same mailbox. Are they equivalent to you?

In either case all you need is a tokeniser. It will allow you to compare exactly what it is you need to determine equivalency.

Some of the existing modules tokenise the addresses internally to some extent, but Email::Address also gives you nice accessors for the resulting tokens, so it would be my prime choice for solving what I perceive your problem to be.


In reply to Re: Practical e-mail address validation by everybody
in thread Practical e-mail address validation by tye

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.