Badger...torable(3pm)

πŸ“¦
version 0.16 Β· 4 versions
, in debian trixie, ubuntu noble, ubuntu resolute

✨ NAME ✨

so bestie, this is Badger::Codec::Storable β€” it's a page from the User Contributed Perl Documentation crew, living in section 3pm (iykyk, that's the module-manpage section). and what does it do?? it encodes and decodes data using Storable. that's the whole vibe. πŸ’…


🌸 SYNOPSIS 🌸

okay so here's the whole thing in action, no cap:

use Badger::Codec::Storable;

my $codec = Badger::Codec::Storable->new();
my $enc   = $codec->encode({ pi => 3.14, e => 2.718 });
my $dec   = $codec->decode($encoded);

look at that. encode, decode, done. iconic. πŸŽ€


πŸ¦‹ DESCRIPTION πŸ¦‹

This module is a subclass of Badger::Codec, and what it does is lean on the freeze() and thaw() subroutines that the Storable module hands out, using them to encode and decode your data. 🧊πŸ”₯

ngl, it's a very thin wrapper around Storable and it offers no functional advantage over it. like, zero extra features, bestie, it's not giving new powers. It exists only to provide a consistent API with the other Badger::Codec modules. that's the assignment and it ate. πŸ’–


πŸ‘‘ METHODS πŸ‘‘

encode($data)

Encodes the data that the first argument points to, using freeze(). 🧊✨

$encoded = Badger::Codec::Storable->encode($data);

decode($html)

Decodes the encoded data you pass in as the first argument, using thaw(). πŸ”₯

$decoded = Badger::Codec::Storable->decode($encoded);

encoder()

This one returns a reference to the real subroutine doing all the encoding work β€” that is, the freeze() method in Storable. she's just pointing at the actual main character. 🫢

decoder()

Same energy, other direction: this returns a reference to the real subroutine doing all the decoding work β€” that is, the thaw() method in Storable. πŸ’œ


πŸ’– AUTHOR πŸ’–

Andy Wardley <http://wardley.org/> β€” the legend behind this whole thing, periodt. 🌟


Copyright (C) 2005-2009 Andy Wardley. All rights reserved.


⭐ SEE ALSO ⭐

  • Badger::Codec β€” the parent, the blueprint, the blueprint's blueprint πŸ’…
  • Storable β€” the module doing the actual heavy lifting under all that cuteness 🧚

and that's the page, bestie!! this one's from perl v5.36.0, dated 2023-08-28 β€” so yeah, go forth and freeze() / thaw() responsibly, mwah πŸ’‹πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from