X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMooseX%2FStorage%2FFormat%2FStorable.pm;h=7d4a43a281f652e96048384697fce351f9b24f78;hb=004bf3ea04d7818116a94bb4b387d8ae1dd10f9a;hp=453f23d218d64724ce60487587bce89e35969aca;hpb=4fa64e865c99a6dcc3bec159a662300151d62fdf;p=gitmo%2FMooseX-Storage.git diff --git a/lib/MooseX/Storage/Format/Storable.pm b/lib/MooseX/Storage/Format/Storable.pm index 453f23d..7d4a43a 100644 --- a/lib/MooseX/Storage/Format/Storable.pm +++ b/lib/MooseX/Storage/Format/Storable.pm @@ -4,7 +4,7 @@ use Moose::Role; use Storable (); -our $VERSION = '0.01'; +our $VERSION = '0.28'; our $AUTHORITY = 'cpan:STEVAN'; requires 'pack'; @@ -20,6 +20,8 @@ sub freeze { Storable::nfreeze( $self->pack(@args) ); } +no Moose::Role; + 1; __END__ @@ -35,36 +37,36 @@ MooseX::Storage::Format::Storable - A Storable serialization role package Point; use Moose; use MooseX::Storage; - + with Storage('format' => 'Storable'); - + has 'x' => (is => 'rw', isa => 'Int'); has 'y' => (is => 'rw', isa => 'Int'); - + 1; - + my $p = Point->new(x => 10, y => 10); - - ## methods to freeze/thaw into + + ## methods to freeze/thaw into ## a specified serialization format - + # pack the class with Storable - my $storable_data = $p->freeze(); - + my $storable_data = $p->freeze(); + # unpack the storable data into the class - my $p2 = Point->thaw($storable_data); + my $p2 = Point->thaw($storable_data); =head1 DESCRIPTION -This module will C and C Moose classes using Storable. It -uses C by default so that it can be easily used -in IPC scenarios across machines or just locally. +This module will C and C Moose classes using Storable. It +uses C by default so that it can be easily used +in IPC scenarios across machines or just locally. -One important thing to note is that this module does not mix well -with the IO modules. The structures that C and C deal with -are Storable's memory representation, and (as far as I know) that -is not easily just written onto a file. If you want file based -serialization with Storable, the please look at the +One important thing to note is that this module does not mix well +with the IO modules. The structures that C and C deal with +are Storable's memory representation, and (as far as I know) that +is not easily just written onto a file. If you want file based +serialization with Storable, the please look at the L role instead. =head1 METHODS @@ -87,7 +89,7 @@ L role instead. =head1 BUGS -All complex software has bugs lurking in it, and this module is no +All complex software has bugs lurking in it, and this module is no exception. If you find a bug please either email me, or add the bug to cpan-RT.