Catman...alizer(3pm)

πŸ“¦
version 1.2025 Β· 4 versions
, in ubuntu resolute, ubuntu stonking

✨ Catman...alizer πŸ’…

okay bestie, listen up πŸ’– this is the page for Catmandu::Serializer β€” it's living in the User Contributed Perl Documentation section of the manual (yes, a 3pm page, we love a Perl module moment πŸŽ€).


🌸 NAME 🌸

Catmandu::Serializer β€” the base class for all the Catmandu Serializers. it's giving founding mother energy πŸ‘‘


✨ SYNOPSIS ✨

here's the whole vibe, copy it exactly bestie, no cap:

package Catmandu::Serializer::Foo;

use Moo;

sub serialize {
    my ($self,$data) = @_;
    .. transform the data to a string and return it...
}

sub deserialize {
    my ($self,$string) = @_;
    ... transform the string into a perl hash ...
}

package MyPackage;

use Moo;

with 'Catmandu::Serializer';

package main;

my $pkg = MyPackage->new;

my $string = $pkg->serialize({ foo => 'bar' });
my $perl   = $pkg->deserialize($string);

# Using Catmandu::Serializer::Foo
my $pkg = MyPackage->new( serialization_format => 'Foo' );

my $string = $pkg->serialize({ foo => 'bar' });
my $perl   = $pkg->deserialize($string);

πŸ¦‹ DESCRIPTION πŸ¦‹

so basically Catmandu::Serializer is a convenience class for yeeting Perl hashes over the wire 🌈 easily. like, without you having to instantiate a Catmandu::Importer and a Catmandu::Exporter β€” because those two are honestly more suited for processing IO streams, and that's just not the moment rn. iykyk πŸ’…


πŸŽ€ ATTRIBUTES πŸŽ€

serialization_format

the name of the package that serializes data. that's it, that's the whole job bestie ✨

serializer

an instance of the package that serializes. the actual little guy doing the work 🫢


πŸ’– METHODS πŸ’–

serialize($perl)

serialize a perl data structure into a string πŸ”₯

deserialize($bytes)

deserialize bytes into a perl data structure πŸ¦‹


πŸ‘‘ SEE ALSO πŸ‘‘

go check these out too, they're all iconic in their own way:

  • Catmandu::Store::DBI
  • Catmandu::Serializer::json
  • Catmandu::Serializer::storabe
  • Catmandu::Serializer::messagepack

ngl there is no exit status, no environment variables and no signals here β€” it's a base class, she's just sitting there looking pretty and being inherited from πŸ’…

and that's the whole page, bestie!! 🌟 this one's running on perl v5.40.1 and it was last touched on 2026-01-24 β€” so it's fresh, it's cute, it ate πŸ’–βœ¨πŸŽ€ mwah, go serialize something 🫢

πŸ“¦ where this page comes from