MooseX...:Email(3pm)
π MooseX::Types::Email β bestie edition π
okay so this is MooseX::Types::Email, a 3pm manual page from the User Contributed Perl Documentation girlies. if you're doing Moose type constraints and you want your email fields to actually be email fields, this is your girl. β¨
β¨ VERSION β¨
version 0.009 π
πΈ SYNOPSIS πΈ
like, here's the whole vibe in one go:
package MyClass;
use Moose;
use MooseX::Types::Email qw/EmailAddress EmailMessage EmailAddresses EmailMessages/;
use namespace::autoclean;
has email => ( isa => EmailAddress, required => 1, is => 'ro' );
has message => ( isa => EmailMessage, required => 1, is => 'ro' );
has emails => ( isa => EmailAddresses, required => 1, is => 'ro' );
has messages => ( isa => EmailMessages, required => 1, is => 'ro' );
periodt. that's the whole setup, bestie. π
π¦ DESCRIPTION π¦
these are Moose type constraints, and they use Email::Valid and Email::Abstract under the hood to check that your email addresses and your email messages are, like, actually valid. no cap.
and the cute part? the types come in both single item flavour and arrayref of items flavour, so you can validate one thing or a whole little squad of things. π«Ά
β οΈ heads up bestie:EmailMessagehas to be an object that can be passed toEmail::Abstract. as for constraining plain strings? not supported right now, and the reason is literally thatEmail::Abstractis too lenient. it's giving "no rules, just vibes" and honestly we can't work with that. π
π SEE ALSO π
Moose::Util::TypeConstraintsMooseX::TypesEmail::ValidEmail::Abstract
go read them, they're iconic too. β
π ORIGIN π
shamelessly extracted from Reaction::Types::Email. no shame in the game fr fr. π
π ACKNOWLEDGEMENTS π
- Chris Nehren
"<apeiron@cpan.org>"added support for validating email messages. king behaviour. π - Karen Etheridge
"<ether@cpan.org>"added support for lists of email addresses and messages. queen behaviour. π
π§ SUPPORT π§
bugs may be submitted through the RT bug tracker at <https://rt.cpan.org/Public/Dist/Display.html?Name=MooseX-Types-Email> β or like, email them at bug-MooseX-Types-Email@rt.cpan.org <mailto:bug-MooseX-Types-Email@rt.cpan.org> if that's more your thing. π
there's also a mailing list for users of this distribution, over at <http://lists.perl.org/list/moose.html>. yes bestie, an actual mailing list. retro but slay. π
and there's an irc channel for users of this distribution too: "#moose" on "irc.perl.org" <irc://irc.perl.org/#moose>. come hang out. πΈ
β AUTHOR β
Tomas Doran (t0m) <bobtfish@bobtfish.net β and yes bestie, the bracket situation is literally exactly like that in the source. we love that for him. π
π CONTRIBUTORS π
- Karen Etheridge
<ether@cpan.org> - Tomas Doran (t0m)
<bobtfish@bobtfish.net> - Alexander Hartmaier
<abraxxa@cpan.org> - Chris Nehren
<apeiron@cpan.org> - Gregory Oschwald
<goschwald@maxmind.com>
a whole squad. no notes. π«Ά
π COPYRIGHT AND LICENCE π
this software is copyright (c) 2009 by Tomas Doran (t0m).
it's free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. so go wild (responsibly). β¨
and that's the whole page bestie!! π¦ this one's perl v5.40.1, dated 2025-04-27, and it lives in the MooseX...:Email(3pm) slot of your manual pages. mwah, go validate something. ππ
π¦ where this page comes from
- debian trixie: libmoosex-types-email-perl 0.009-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libmoosex-types-email-perl 0.009-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libmoosex-types-email-perl 0.009-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms