1MooseX::Storage::IO::StUosrearblCeoFnitlrei(b3u)ted PerlMoDoosceuXm:e:nSttaotriaogne::IO::StorableFile(3)
2
3
4
6 MooseX::Storage::IO::StorableFile - An Storable File I/O role
7
9 package Point;
10 use Moose;
11 use MooseX::Storage;
12
13 with Storage('io' => 'StorableFile');
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 load/store a class
23 ## on the file system
24
25 $p->store('my_point');
26
27 my $p2 = Point->load('my_point');
28
30 This module will "load" and "store" Moose classes using Storable. It
31 uses "Storable::nstore" by default so that it can be easily used across
32 machines or just locally.
33
34 One important thing to note is that this module does not mix well with
35 the other Format modules. Since Storable serialized perl data
36 structures in it's own format, those roles are lagely unnecessary.
37
38 However, there is always the possibility that having a set of
39 "freeze/thaw" hooks can be useful, so because of that this module will
40 attempt to use "freeze" or "thaw" if that method is available. Of
41 course, you should be careful when doing this as it could lead to all
42 sorts of hairy issues. But you have been warned.
43
45 load ($filename)
46 store ($filename)
47
48 Introspection
49 meta
50
52 All complex software has bugs lurking in it, and this module is no
53 exception. If you find a bug please either email me, or add the bug to
54 cpan-RT.
55
57 Stevan Little <stevan.little@iinteractive.com>
58
60 Copyright 2007-2008 by Infinity Interactive, Inc.
61
62 <http://www.iinteractive.com>
63
64 This library is free software; you can redistribute it and/or modify it
65 under the same terms as Perl itself.
66
67
68
69perl v5.12.0 2009-07-1M4ooseX::Storage::IO::StorableFile(3)