MooseX...tection(3pm)

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

okay bestie πŸ’– quick heads-up before we dive in: this page lives in the User Contributed Perl Documentation (that's the manual name, very "written by the community, for the community" energy 🫢), and the header at the top just squishes the whole long name down to MooseX...tection(3pm) because apparently life is too short to spell it out. anyway, let's GO ✨


πŸ’– NAME πŸ’–

MooseX::Storage::Engine::Trait::DisableCycleDetection β€” a custom trait to bypass cycle detection πŸŒ€πŸ’€


🌸 VERSION 🌸

version 0.53 β€” that's the vibe, that's the number, periodt.


✨ SYNOPSIS ✨

okay so here's the whole moment, in code, exactly as it happens:

package Double;
use Moose;
use MooseX::Storage;
with Storage( traits => ['DisableCycleDetection'] );

has 'x' => ( is => 'rw', isa => 'HashRef' );
has 'y' => ( is => 'rw', isa => 'HashRef' );

my $ref = {};

my $double = Double->new( 'x' => $ref, 'y' => $ref );

$double->pack;

look at that. $ref in both slots, the same ref, bestie. iconic behavior honestly πŸ‘‘


πŸ¦‹ DESCRIPTION πŸ¦‹

so MooseX::Storage ships with a little baby check for circular references. it's primitive. it's doing its best. 😭 but here's the thing β€” that check also triggers on the simple cases like the one in the Synopsis. like, you didn't even do anything wrong and it's already side-eyeing you.

and that's where DisableCycleDetection comes in πŸ’…

providing the DisableCycleDetection trait disables checks for any cyclical references. so if you know what you're doing, you can bypass this check. no cap. if you do not know what you're doing, that's a you problem and it's giving future debugging arc πŸ™ˆ

just so we're clear: this trait gets applied to an instance of MooseX::Storage::Engine. for the user-visible version β€” the one actually shown up in the SYNOPSIS β€” head over to MooseX::Storage::Traits::DisableCycleDetection. two different things, don't mix them up, iykyk 🧚

🫢 SUPPORT 🫢

found a bug? yeah, same, there's a whole process:


πŸ‘‘ AUTHORS πŸ‘‘

the legends, in order:

  • Chris Prather <chris.prather@iinteractive.com> πŸ’œ
  • Stevan Little <stevan.little@iinteractive.com> πŸ’œ
  • Χ™Χ•Χ‘Χœ Χ§Χ•Χ’'מן (Yuval Kogman) <nothingmuch@woobling.org> πŸ’œ

this software is copyright (c) 2007 by Infinity Interactive, Inc.

and it's 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! πŸ¦‹ this ran on perl v5.36.0 and the date on the tin is 2022-10-16, so if you're reading this in the future, hi, you're doing great, drink some water πŸ’§βœ¨ mwah, bye! πŸŽ€πŸ’…

πŸ“¦ where this page comes from