Stephen Adkins > App-Context > App::Serializer::Scalar

Download:
App-Context-0.968.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  1
Open  0
View/Report Bugs
Module Version: 6001   Source  

NAME ^

App::Serializer::Scalar - A "serializer" which merely encodes and decodes scalars

SYNOPSIS ^

    use App;

    $context = App->context();
    $serializer = $context->service("Serializer");  # or ...
    $serializer = $context->serializer();
    $data = {
        an => 'arbitrary',
        collection => [ 'of', 'data', ],
        of => {
            arbitrary => 'depth',
        },
    };
    $perl = $serializer->serialize($data);
    $data = $serializer->deserialize($perl);
    print $serializer->dump($data), "\n";

DESCRIPTION ^

The Scalar serializer encodes (with serialize()) and decodes with (deserialize()) a scalar. It might be used to encode a binary blob as a hex string and then decode it agains.

syntax highlighting: