Kent Fredric > Paludis-ResumeState-Serialization-0.01000409 > Paludis::ResumeState::Serialization::Basic

Download:
Paludis-ResumeState-Serialization-0.01000409.tar.gz

Dependencies

Annotate this POD

Website

CPAN RT

Open  0
View/Report Bugs
Module Version: 0.01000409   Source   Latest Release: Paludis-ResumeState-Serialization-0.01000410

NAME ^

Paludis::ResumeState::Serialization::Basic - Basic & Consistent Resume-State serialization interface.

VERSION ^

version 0.01000409

SYNOPSIS ^

See ::Serialization for recommended usage.

This interface provides a very "dumb" but consistent serialization support.

    ResumeData@1234(foo="bar";baz="quux";doo=c(1="baz";2="buzz";3="bizz";count="3";);borzoi=Hysterical(););

Will be deserialized as follows:

    {
      ResumeSpec => {
        type       => 'class',
        classname  => 'ResumeData',
        pid        => '1234',
        parameters => [
          [ 'foo', 'bar' ],
          [ 'baz', 'quux' ],
          [
            'doo',
            {
              type       => 'array',
              parameters => [ 'baz', 'buzz', 'bizz' ],
              count      => 3
            }
          ],
          [
            'borzoi',
            {
              type       => 'class',
              classname  => 'Hysterical',
              parameters => [],
            }
          ],
        ],
      },
    }

And giving that exact structure to serialize, will return the aforementioned serialized string.

METHODS ^

serialize

    my $string = ->serialize( $data );

deserialize

    my $object = ->deserialize( $content );

AUTHOR ^

Kent Fredric <kentnl@cpan.org>

COPYRIGHT AND LICENSE ^

This software is copyright (c) 2011 by Kent Fredric <kentnl@cpan.org>.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

syntax highlighting: