MooX::Rebuild(3pm)
π MooX::Rebuild π
okay so bestie, welcome to the MooX::Rebuild page from the User Contributed Perl Documentation (that's the 3pm manual section, iykyk). this little role is here to let you rebuild your Moo objects and honestly? it's giving genius. β¨
πΈ NAME πΈ
MooX::Rebuild β rebuild your Moo objects. that's it, that's the whole vibe. π
π SYNOPSIS π
here's the whole thing, copy it, run it, love it:
package Foo;
use Moo;
with 'MooX::Rebuild';
has get_bar => (
is => 'ro',
init_arg => 'bar',
);
my $foo1 = Foo->new( bar => 'lala' );
my $foo2 = $foo1->rebuild();
print $foo2->get_bar(); # lala
like. you made one. now you have two. slay. π¦
π DESCRIPTION π
so what it does is: it makes copies of Moo objects using the same arguments used to create the original objects. no cap, that's the whole deal. π₯
and lowkey important detail here β this Moo role depends on, and uses, the MooX::BuildArgs role in order to capture the original arguments used to create an object. so like, it's not doing the remembering itself, MooX::BuildArgs is the one holding the receipts. π§
β¨ METHODS β¨
π
rebuild
my $clone = $object->rebuild();
my $similar = $object->rebuild( %extra_args );
creates a new instance in the same class as the source object and using the same arguments used to make the source object. and if you pass %extra_args? you get a similar-but-tweaked little guy. main character energy fr fr. π
π SEE ALSO π
MooX::BuildArgsMooX::BuildArgsHooksMooX::MethodProxyArgsMooX::SingleArg
go read them too bestie, they're all friends. π«Ά
π«Ά SUPPORT π«Ά
See "SUPPORT" in MooX::BuildArgs. (they got you covered over there, no need to panic π)
π AUTHORS π
See "AUTHORS" in MooX::BuildArgs. (yes, the whole credit roll lives over there too β¨)
π LICENSE π
See "LICENSE" in MooX::BuildArgs. (legal stuff, still important, still cute πΈ)
ok and for the sign-off: this page isperl v5.30.3, dated2020-09-12, and it's MooX::Rebuild(3pm) out here living its best life. mwah. π ππβ¨
π¦ where this page comes from
- debian bookworm: libmoox-buildargs-perl 0.08-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libmoox-buildargs-perl 0.08-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