The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Data::Transpose::EmailValid - Perl extension to check if a mail is valid (with some autocorrection)

SYNOPSIS

  use Data::Transpose::EmailValid;

  my $email = Data::Transpose::EmailValid->new;

  ok($email->is_valid("user@domain.tld"), "Mail is valid");

  ok(!$email->is_valid("user_e;@domain.tld"), "Mail is not valid");

  warn $email->reason; # output the reason of the failure

DESCRIPTION

This module check if the mail is valid, using the Email::Valid module. It also provides some additional methods.

METHODS

new

Constructor. It doesn't accept any arguments.

email_valid

Accessor to the Email::Valid object

input

Accessor to the input email string.

output

Accessor to the output email string.

reset_all

Clear all the internal data

$obj->is_valid($emailstring);

Returns the email passed if valid, false underwise.

$obj->email

Returns the last checked email.

$obj->reason

Returns the reason of the failure of the last check, false if it was successful.

$obj->suggestion

This module implements some basic autocorrection. Calling ->suggestion after a successfull test, will return the suggested value if the input was different from the output, false otherwise.

AUTHOR

Uwe Voelker <uwe@uwevoelker.de>

LICENSE AND COPYRIGHT

Copyright 2012-2014 Uwe Voelker <uwe@uwevoelker.de>.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.