MooseX...:Basic(3pm)

πŸ“¦
version 0.53 Β· 5 versions
, in ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– 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. πŸ‘‘


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