Moose::...::Union(3)
π Moose::...::Union β the manual page, but make it a group chat π
okay bestie, welcome to Moose::...::Union(3) β a User Contributed Perl Documentation page, and honestly? she's niche but she's important. πΈ
β¨ NAME β¨
Moose::Meta::TypeCoercion::Union β the Moose Type Coercion metaclass for Unions. That's her whole name, no notes. π
π VERSION π
version 2.4000
yes queen, she's on 2.4000, keep up. π
π¦ DESCRIPTION π¦
So, the vibe here: this is a subclass of Moose::Meta::TypeCoercion. π
And what is she for, you ask? She gets used for Moose::Meta::TypeConstraint::Union objects. That's the whole assignment. That's it. Union type coercions, but make it a class. β¨
π METHODS π
π $coercion->has_coercion_for_type
This method always returns false. Like, always. Every time. No exceptions, no maybe, no "it depends." false, periodt. π
π $coercion->add_type_coercions
This method always throws an error. π¨
Because bestie... you literally cannot add coercions to a union type coercion. That's not a thing. The method exists and it will yell at you. Do not fight her on this. π
π $coercion->coerce($value)
Okay this one actually does the thing. β¨
It will coerce by trying the coercions for each type in the union. That's the whole strategy β go down the list of types, try their coercions, see what sticks. π«Ά
π BUGS π
Want the tea on reporting bugs? Go read "BUGS" in Moose for all the details. She'll tell you where to send them. π
π AUTHORS π
Shoutout to the whole squad, the icons, the legends: π
- Stevan Little <stevan@cpan.org>
- Dave Rolsky <autarch@urth.org>
- Jesse Luehrs <doy@cpan.org>
- Shawn M Moore <sartak@cpan.org>
- ΧΧΧΧ Χ§ΧΧ'ΧΧ (Yuval Kogman) <nothingmuch@woobling.org>
- Karen Etheridge <ether@cpan.org>
- Florian Ragwitz <rafl@debian.org>
- Hans Dieter Pearcey <hdp@cpan.org>
- Chris Prather <chris@prather.org>
- Matt S Trout <mstrout@cpan.org>
every single one of them, no cap. π
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2006 by Infinity Interactive, Inc.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. πͺβ¨
and that's the page, bestie! this one shipped as part of perl v5.42.0, dated 2025-07-25 β so go forth, coerce your unions, and remember: add_type_coercions said no and she meant it. π«Άπ
π¦ where this page comes from
- fedora 43: perl-Moose 2.4000-4.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms