Man pages sections > man3 > Catmandu::Serializer::json

Catmandu::Serializer - A (de)serializer from and to json

Catmandu::Serializer::json(3pm) User Contributed Perl Documentation Catmandu::Serializer::json(3pm)

NAME

Catmandu::Serializer - A (de)serializer from and to json

SYNOPSIS

    package MyPackage;
    use Moo;
    with 'Catmandu::Serializer';
    
    # You have now  serialize and deserialize methods available
    package main;
    my $obj = MyPackage->new;
    my $obj = MyPackage->new(serializer => 'json');
    $obj->serialize( { foo => 'bar' } );  # JSON 
    $obj->deserialize( "{'foo':'bar'}" );  # Perl

SEE ALSO

Catmandu::Serializer
2017-10-01 perl v5.26.0