t has stored in it in JSON format:
perl -MPDL::Doc -MJSON::PP -e \
'print encode_json +PDL::Doc->new(PDL::Doc::_find_inc([qw(PDL pdldoc.db)]))->gethash' |
json_pp -json_opt pretty,canonical
use overload fallback => 1;
sub cplx { bless &Math::Complex::cplx, __PACKAGE__ }
# needed for JSON serialisation
sub FREEZE {
my ($self, $serialiser) = @_;
return %$self;
}
sub THAW {
t has stored in it in JSON format:
perl -MPDL::Doc -MJSON::PP -e \
'print encode_json +PDL::Doc->new(PDL::Doc::_find_inc([qw(PDL pdldoc.db)]))->gethash' |
json_pp -json_opt pretty,canonical
# Add dynamic prereqs to the included modules list (if we can)
my ($source) = grep { -f } 'MYMETA.json', 'MYMETA.yml';
if ( $source && $HAS_CPAN_META ) {
if ( my $meta = eval { CPAN::Meta->load_fi
correct,
but cannot now be changed due to backward compatibility.
=for example
use JSON;
my $json = encode_json unpdl $pdl;
=for bad
unpdl converts any bad values into the string 'BAD'.
=cut
=
JSON::MaybeXS;
$encoder = JSON::MaybeXS->new(allow_tags => 1);
my $ndarray = xvals (5,2);
my $encoded_json = $encoder->encode ($ndarray);
my $decoded_ndarray = $encoder->decode ($encoded_json
);
=head1 DESCRIPTION
Serialisation packages such as C<Storable>, C<Sereal>, C<JSON::MaybeXS>
and C<CBOR::XS> implement
object persistence for Perl data structures that can
contain arbitrary Perl ob
as packages that support
the L<Types::Serialiser> protocol (currently L<Sereal>, L<CBOR::XS> and JSON packages).
Note that packages supporting the C<Types::Serialiser> protocol need to have their
re
t has stored in it in JSON format:
perl -MPDL::Doc -MJSON::PP -e \
'print encode_json +PDL::Doc->new(PDL::Doc::_find_inc([qw(PDL pdldoc.db)]))->gethash' |
json_pp -json_opt pretty,canonical
correct,
but cannot now be changed due to backward compatibility.
=for example
use JSON;
my $json = encode_json unpdl $pdl;
=for bad
unpdl converts any bad values into the string 'BAD'.
=cut
=