MooseX::Types::Email - Email address validation type constraint for Moose.
package MyClass; use Moose; use MooseX::Types::Email qw/EmailAddress EmailMessage/; use namespace::autoclean; has email => ( isa => EmailAddress, required => 1, is => 'ro' ); has message => ( isa => EmailMessage, required => 1, is => 'ro' );
Moose type constraints which uses Email::Valid and Email::Abstract to check for valid email addresses and messages.
Note that EmailMessage must be an object that can be passed to Email::Abstract. Currently, constraining strings is not supported due to the leniency of Email::Abstract.
EmailMessage
Tomas Doran (t0m) <bobtfish@bobtfish.net>
<bobtfish@bobtfish.net>
Shamelessly extracted from Reaction::Types::Email.
Chris Nehren <apeiron@cpan.org> added support for validing email messages.
<apeiron@cpan.org>
Copyright 2009 the above AUTHORS and CONTRIBUTORS.
This library is free software, you can redistribute it and/or modify it under the same terms as Perl itself.
To install MooseX::Types::Email, copy and paste the appropriate command in to your terminal.
cpanm
cpanm MooseX::Types::Email
CPAN shell
perl -MCPAN -e shell install MooseX::Types::Email
For more information on module installation, please visit the detailed CPAN module installation guide.