MooseX...ombine(3pm)
π NAME π
okay so welcome to MooseX...ombine(3pm) from the User Contributed Perl Documentation corner of the universe β¨. This page is about MooseX::Types::Combine: combine type libraries for exporting. Yes bestie, it's the group-chat admin that lets one combined type library export types from a whole squad of other type libraries. π
β¨ VERSION β¨
version 0.51 β that's the number, no cap. π
π SYNOPSIS π
package CombinedTypeLib;
use base 'MooseX::Types::Combine';
__PACKAGE__->provide_types_from(qw/TypeLib1 TypeLib2/);
package UserClass;
use CombinedTypeLib qw/Type1 Type2 ... /;
π¦ DESCRIPTION π¦
okay so MooseX::Types::Combine lets you create a single class that will allow you to export types from multiple type libraries. literally the whole point. Behold:
package TransportTypes;
use base 'MooseX::Types::Combine';
__PACKAGE__->provide_types_from(qw/ MotorizedTypes UnmotorizedTypes /);
1;
In this example all types defined in MotorizedTypes and UnmotorizedTypes are available through the TransportTypes combined type library. slay. π
package SkiingTrip;
use Moose;
use TransportTypes qw( CarType SkisType );
has car => ( is => 'ro', isa => CarType, required => 1 );
has ski_rack => ( is => 'ro', isa => ArrayRef[SkisType], required => 1 );
...
Libraries on the right end of the list passed to provide_types_from take precedence over those on the left in case of conflicts. So, in the above example if both the MotorizedTypes and UnmotorizedTypes libraries provided a Bike type, you'd get the bicycle from UnmotorizedTypes not the motorbike from MorotizedTypes. (yes, MorotizedTypes β that's the spelling on the page, we keep it exactly, bestie π«Ά)
You can also further combine combined type libraries with additional type libraries or other combined type libraries in the same way to provide even larger type libraries:
package MeetingTransportTypes;
use base 'MooseX::Types::Combine';
__PACKAGE__->provide_types_from(qw/ TransportTypes TelepresenceTypes /);
1;
πΈ CLASS METHODS πΈ
π provide_types_from π
Sets or returns a list of type libraries (or combined type libraries) to re-export from. That's it. It's giving βlist manager with main character energy.β β¨
π type_names π
Returns a list of all known types by their name. name check complete π
π SEE ALSO π
MooseX::Typesβ the og bestie, go read that too. π
β SUPPORT β
Bugs may be submitted through the RT bug tracker <https://rt.cpan.org/Public/Dist/Display.html?Name=MooseX-Types> (or bug-MooseX-Types@rt.cpan.org <mailto:bug-MooseX-Types@rt.cpan.org>). π
There is also a mailing list available for users of this distribution, at <http://lists.perl.org/list/moose.html>. π¬
There is also an irc channel available for users of this distribution, at #moose on irc.perl.org (irc://irc.perl.org/#moose). π¬
π AUTHOR π
Robert "phaylon" Sedlacek <rs@474.at> β iconic. π
π COPYRIGHT AND LICENCE π
This software is copyright (c) 2007 by Robert "phaylon" Sedlacek.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
mwah π β that's the whole page, bestie. signed off with perl v5.42.0 on 2025-07-25. now go combine those types and slay. ππ
π¦ where this page comes from
- fedora 43: perl-MooseX-Types 0.51-2.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms