in reply to Email Address Syntax Checker

In addition to Email::Valid, there's also a Mail::RFC822::Address which not only has no external dependencies (Email::Valid uses Net::DNS) but also exists as a PPM from the primary PPM repository.

Chris
M-x auto-bs-mode

Replies are listed 'Best First'.
Re: Re: Email Address Syntax Checker
by jryan (Vicar) on May 15, 2002 at 14:28 UTC
    The only problem with those 2 modules is that they follow the exact RFC standard. Why is it a problem to follow standard? Because there are millions of email addresses out there that have a . before the @ (without the . being quoted), which is not RFC valid. I personally use Email::Valid::Loose, which contains all of the great features of Email::Valid yet doesn't break on my own email adderss.

      You might want to check again:

      #!/usr/bin/perl use strict; use Email::Valid; use Mail::RFC822::Address; my $address = 'ryan.311@osu.edu'; print 'Email::Valid: ', ( Email::Valid->address( $address ) ? 'yes' : 'no' ), "\n"; print 'Mail::RFC822::Address: ', ( Mail::RFC822::Address::valid( $address ) ? 'yes' : 'no' ), "\n";

      Output:

      Email::Valid: yes Mail::RFC822::Address: yes

      Chris
      M-x auto-bs-mode