To my surprise, an valid email address preceding the
@ becomes disqualifiied by
Email::Valid when a
. is appended to it.
Why would that make an email invalid?
code
use Email::Valid;
use strict;
sub check {
my $o = shift;
my $address = shift;
print "email $address is ";
print ($o->address($address) ? '' : 'not');
print " valid\n";
}
my @address = qw(
jim@mail.com
jim.@mail.com
jim.beam@mail.com
.jim@mail.com
jim-@mail.com
-jim@mail.com
);
my $ev = Email::Valid->new;
check ($ev,$_) for @address;
results
[tbone@horse1 email-valid]$ perl ev.pl
email jim@mail.com is valid
email jim.@mail.com is not valid
email jim.beam@mail.com is valid
email .jim@mail.com is not valid
email jim-@mail.com is valid
email -jim@mail.com is not valid
[tbone@horse1 email-valid]$
<address>
</address>
Last modified: Wed Aug 20 15:43:59 PDT 2003
</body>
</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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.