1MooseX::Storage::FormatU:s:eSrtoCroanbtlrei(b3u)ted PerlMoDoosceuXm:e:nSttaotriaogne::Format::Storable(3)
2
3
4
6 MooseX::Storage::Format::Storable - A Storable serialization role
7
9 package Point;
10 use Moose;
11 use MooseX::Storage;
12
13 with Storage('format' => 'Storable');
14
15 has 'x' => (is => 'rw', isa => 'Int');
16 has 'y' => (is => 'rw', isa => 'Int');
17
18 1;
19
20 my $p = Point->new(x => 10, y => 10);
21
22 ## methods to freeze/thaw into
23 ## a specified serialization format
24
25 # pack the class with Storable
26 my $storable_data = $p->freeze();
27
28 # unpack the storable data into the class
29 my $p2 = Point->thaw($storable_data);
30
32 This module will "thaw" and "freeze" Moose classes using Storable. It
33 uses "Storable::nfreeze" by default so that it can be easily used in
34 IPC scenarios across machines or just locally.
35
36 One important thing to note is that this module does not mix well with
37 the IO modules. The structures that "freeze" and "thaw" deal with are
38 Storable's memory representation, and (as far as I know) that is not
39 easily just written onto a file. If you want file based serialization
40 with Storable, the please look at the MooseX::Storage::IO::StorableFile
41 role instead.
42
44 freeze
45 thaw ($stored)
46
47 Introspection
48 meta
49
51 All complex software has bugs lurking in it, and this module is no
52 exception. If you find a bug please either email me, or add the bug to
53 cpan-RT.
54
56 Stevan Little <stevan.little@iinteractive.com>
57
59 Copyright 2007-2008 by Infinity Interactive, Inc.
60
61 <http://www.iinteractive.com>
62
63 This library is free software; you can redistribute it and/or modify it
64 under the same terms as Perl itself.
65
66
67
68perl v5.12.0 2009-07-1M4ooseX::Storage::Format::Storable(3)