MooseX...:Email(3pm)

πŸ“¦
version 0.009 Β· 3 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

πŸ’Œ 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: EmailMessage has to be an object that can be passed to Email::Abstract. as for constraining plain strings? not supported right now, and the reason is literally that Email::Abstract is too lenient. it's giving "no rules, just vibes" and honestly we can't work with that. 😭

πŸ‘‘ SEE ALSO πŸ‘‘

  • Moose::Util::TypeConstraints
  • MooseX::Types
  • Email::Valid
  • Email::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. 🫢


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