logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Badger::Codec::Storable - encode/decode data using Storable

Author

       Andy Wardley <http://wardley.org/>

Description

       This module implements a subclass of Badger::Codec which uses the "freeze()" and "thaw()" subroutines
       provided by the Storable module to encode and decode data.

       It a very thin wrapper around the Storable module and offers no functional advantage over it.  It exist
       only to provide a consistent API with other Badger::Codec modules.

Methods

encode($data)
       Encodes the data referenced by the first argument using "freeze()".

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

   decode($html)
       Decodes the encoded data passed as the first argument using "thaw()".

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

   encoder()
       This method returns a reference to the real subroutine that's doing all the encoding work, i.e. the
       "freeze()" method in Storable.

   decoder()
       This method returns a reference to the real subroutine that's doing all the decoding work, i.e. the
       "thaw()" method in Storable.

Name

       Badger::Codec::Storable - encode/decode data using Storable

See Also

       Badger::Codec, Storable

perl v5.36.0                                       2023-08-28                       Badger::Codec::Storable(3pm)

Synopsis

           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);

See Also