PDL::IO::Sereal - Load/save complete PDL content serialized via Sereal
use PDL; use PDL::IO::Sereal ':all'; my $pdl = random(100, 100, 100); # write piddle to file $pdl->wsereal('saved-piddle1.sereal'); # read piddle from file my $new_pdl = rsereal('saved-piddle1.sereal');
Loading and saving PDL piddle serialized via Sereal (by default with ZLIB compression). Saved files should be portable across different architectures and PDL versions (there might be some troubles with piddles of 'indx' type which are not portable between perls with 64bit vs. 32bit integers).
By default PDL::IO::Sereal doesn't import any function. You can import individual functions like this:
use PDL::IO::Sereal qw(rsereal wsereal);
Or import all available functions:
use PDL::IO::Sereal ':all';
BEWARE: any use PDL::IO::Sereal also installs FREEZE and THAW functions into PDL namespace - see Sereal::Encoder.
use PDL::IO::Sereal
FREEZE
THAW
PDL
wsereal($pdl, 'piddle1.sereal'); # or $pdl->wsereal('piddle2.sereal'); # or even $pdl->wsereal('piddle3.sereal')->minus($x, 0)->wsereal('piddle4.sereal');
$pdl = rsereal('saved-piddle.sereal');
PDL, Sereal, Sereal::Encoder, Sereal::Decoder
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
2015 KMX <kmx@cpan.org>
To install PDL::IO::Sereal, copy and paste the appropriate command in to your terminal.
cpanm
cpanm PDL::IO::Sereal
CPAN shell
perl -MCPAN -e shell install PDL::IO::Sereal
For more information on module installation, please visit the detailed CPAN module installation guide.