MooseX...:Basic(3pm)
π MooseX::Storage::Basic π
okay bestie, so this is MooseX::Storage::Basic from the User Contributed Perl Documentation crew, and it is exactly what it sounds like: the simplest level of serialization. no notes. perfection. β¨
version 0.53, we love her π
πΈ SYNOPSIS πΈ
like, here's the whole vibe:
package Point;
use Moose;
use MooseX::Storage;
with Storage;
has 'x' => (is => 'rw', isa => 'Int');
has 'y' => (is => 'rw', isa => 'Int');
1;
my $p = Point->new(x => 10, y => 10);
## methods to pack/unpack an
## object in perl data structures
# pack the class into a hash
$p->pack(); # { __CLASS__ => 'Point-0.01', x => 10, y => 10 }
# unpack the hash into a class
my $p2 = Point->unpack({ __CLASS__ => 'Point-0.01', x => 10, y => 10 });
# unpack the hash, with injection of additional paramaters
my $p3 = Point->unpack( $p->pack, inject => { x => 11 } );
not me rereading that comment β paramaters, yeah, we keep it fr fr, character for character, no touchy π
π¦ DESCRIPTION π¦
so this is the most basic form of serialization. literally the starter pack. the training wheels. the main character energy of storage modules.
and here's the tea: it's used by default but the exported Storage function. (yes, "but". we're keeping the original's exact words here, bestie, it's giving β¨mysteryβ¨, moving on.)
π METHODS π
π pack ([ disable_cycle_check = 1])>
okay so if you pass in the disable_cycle_check argument, it disables checks for any cyclical references. and ngl the current implementation of that check is rather naive π so if you genuinely know what you're doing, you can bypass it. go off, i guess.
β οΈ heads up bestie: this trait is applied on a perl-case basis</> β wait, no, that's the original's typo, we're keeping it, but the meaning is: it's per-case.
so, for real: this trait is applied on a per-case basis. if you want this flag set for all the objects that inherit from this role, go check out MooseX::Storage::Traits::DisableCycleDetection. she's the group version. π«Ά
π unpack ($data [, inject = { key => val, ... } ] )>
pass the inject argument and you get to hand the class' new function some extra arguments π β or straight up override ones that came in from the serialized data. your data, your rules, slay.
π SUPPORT π
bugs? they may be submitted through the RT bug tracker πΈ
https://rt.cpan.org/Public/Dist/Display.html?Name=MooseX-Storage
or you can email bug-MooseX-Storage@rt.cpan.org β ikyk how email works, bestie.
there's also a mailing list available for users of this distribution, right here:
http://lists.perl.org/list/moose.html
and there's also an irc channel available for users of this distribution, at #moose on irc.perl.org (irc://irc.perl.org/#moose). come hang out, the vibe check is immaculate π
π§ AUTHORS π§
- Chris Prather
<chris.prather@iinteractive.com> - Stevan Little
<stevan.little@iinteractive.com> - ΧΧΧΧ Χ§ΧΧ'ΧΧ (Yuval Kogman)
<nothingmuch@woobling.org>
legends. every single one. π
π COPYRIGHT AND LICENSE π
this software is copyright (c) 2007 by Infinity Interactive, Inc.
it's free software π¦ you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. periodt.
and that's the whole page, bestie!! this was MooseX::Storage::Basic(3pm), version 0.53, and this doc was baked with perl v5.36.0 back on 2022-10-16 π lowkey iconic, highkey timeless. mwah π
β¨
π¦ where this page comes from
- ubuntu noble: libmoosex-storage-perl 0.53-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libmoosex-storage-perl 0.53-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libmoosex-storage-perl 0.53-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