MooseX...Minimal(3pm)
πΈ MooseX::Has::Sugar::Minimal π
ok so like, this is the User Contributed Perl Documentation page for MooseX::Has::Sugar::Minimal (you'll see it filed under MooseX...Minimal(3pm) in your man viewer, iykyk) and bestie. it is SO niche. it is SO useful. let's get into it π«Ά
β¨ NAME β¨
MooseX::Has::Sugar::Minimal β Less Sugary Syntax for moose 'has' fields π
π VERSION π
version 1.000006
π¦ SYNOPSIS π¦
okay so this is a legacy variant of Sugar, and the way it works is it ONLY exports the ro and rw functions β literally just those two, the way MooseX::Has::Sugar used to do back in the day with ":is". nostalgia core fr fr π
use MooseX::Types::Moose qw( Str );
use MooseX::Has::Sugar::Minimal;
has foo => (
isa => Str,
is => ro,
required => 1,
);
has bar => (
isa => Str,
is => rw,
lazy_build => 1,
);
and like. all of the functions are exported by The Sub::Exporter Module. no cap, that's just how it is β¨
π EXPORT GROUPS π
":default"
Exports ":is" π«
":is"
Exports bare, ro, rw π
π EXPORTED FUNCTIONS π
bare
returns ('bare')
ro
returns ('ro')
rw
returns ('rw')
like. that's it. that's the whole function. iconic behaviour honestly π
π CONFLICTS π
MooseX::Has::Sugar
MooseX::Has::Sugar::Saccharin
ok so this module is not intended to be used in conjunction with ::Sugar or ::Sugar::Saccharin. and there is a whole reason for that, so listen up bestie π
We all export ro and rw in different ways. it's giving group project where everyone shows up with a different vibe. chaos.
If you do however want to use them in conjunction, specific imports must be done on MooseX::Has::Sugar's side to stop it exporting different ro/rw. Any of the below should be fine. π«Ά
use MooseX::Has::Sugar::Minimal;
use MooseX::Has::Sugar qw( :attrs );
has foo =>( is => rw , lazy_build );
use MooseX::Has::Sugar::Minimal;
use MooseX::Has::Sugar qw( lazy_build );
has foo =>( is => rw , lazy_build );
π AUTHOR π
Kent Fredric <kentnl@cpan.org> π
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2017 by Kent Fredric <kentfredric@gmail.com>.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. slay π
and that's the whole page bestie!! short, sweet, extremely specific. main character energy from a module that exports literally three strings π
this was perl v5.34.0, dated 2022-06-15, and you found it in the MooseX...Minimal(3pm) slot of your manual. periodt. β¨π¦πΈ
π¦ where this page comes from
- debian bookworm: libmoosex-has-sugar-perl 1.000006-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libmoosex-has-sugar-perl 1.000006-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libmoosex-has-sugar-perl 1.000006-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libmoosex-has-sugar-perl 1.000006-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libmoosex-has-sugar-perl 1.000006-2 Β· 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