Catman...alizer(3pm)
β¨ 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::DBICatmandu::Serializer::jsonCatmandu::Serializer::storabeCatmandu::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
- ubuntu resolute: libcatmandu-perl 1.2025-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libcatmandu-perl 1.2025-1 Β· 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