Badger...torable(3pm)
β¨ 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 π
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
- debian trixie: libbadger-perl 0.16-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libbadger-perl 0.16-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libbadger-perl 0.16-3 Β· 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