Data-Roundtrip
view release on metacpan or search on metacpan
String input to yaml2perl() is now being untainted in order
to avoid a bug with Perls < v5.14 which causes YAML::PP to
loop indefinetely and the OS to kill the script. Until YAML::PP is fixed.
0.25 2023-11-07 12:00
Change untainting yaml string input from ($yaml_string) = each %{{$yaml_string,0}};
to ($yaml_string) = keys %{{$yaml_string,0}}; because it was
warning about "each on anonymous hash will always start from the beginning"
Also a new test file was added (t/14-yaml-tainted-input.t) to
test yaml2perl with tainted yaml string as input.
0.26 2023-12-29 12:00
Clarified the documentation that internally YAML::PP is used and
that it has no problem with handling yaml strings which contain
escaped quotes.
0.27 2024-03-14 11:00
Chnaged the shortcut command-line interface
for the provided scripts so that
-r is equivalent to --terse and -d is equivalent to --indent.
Replaced 'warn()' with 'print STDERR'.
In eval()'ing code which dies (e.g. my $res = eval { YAML::PP::Dump($pv) }; ) I have used this 'if( $@ || ! defined($res) )' which now became if( ! defined($res) )'.
0.28 2024-04-08 18:00
Test file "t/12-from-file.t", at very few times, fails
(under M$) because comparing a data structure fails on
comparing two floats which must be the same and are the
same except the last decimal digit. As from this version,
the floats in the test data for this particular test is shorten
to max 4 decimal places.
These subs: dump2perl, dump2json, dump2yaml and dump2dump
are, from now, not exported by default neither they are
part of any export tag-group (they used to be in the ':dump' tag-group)
These subs must now be explicitly imported.
The reason is that 'dump2perl' (and the rest use this)
is eval'ing its input which may come from user.
Eval'ing (unchecked) user input is considered a security problem.
These subs will not be removed but be imported
by specific caller request.
Test "t/04-dump2-use-is-explicit.t" has been added to check that
these subs are not exported by default.
0.29 2024-10-15 18:00
Test file "t/12-from-file.t", still fails because of the issue
mentioned Changes of v0.28. Therefore I have reduced the number
of digits to zero. This is a minor issue and spent more energy than
necessary for it.
0.30 2025-07-28 00:00
Added a new feature to allow perl2json() to
handle input (Perl) data structures which may
contain objects, with perl2json($data, {convert_blessed=>1}),
provided the object implements a TO_JSON() method.
Switched to Test::TempDir::Tiny in test files.
And removed taint mode from test '12-from-file.t'
0.31 2025-12-03 01:00
Experimentally adding one more dependency: Devel::StackTrace
in order to get a stack trace when subs fail.
Now json2* subs take optional parameters in the form of
a hashref. At the moment it accepts 'boolean_values' parameter
as an ARRAY ref, of 2 items, to be passed on to JSON (it allows the mapping
of boolean values to the specified ARRAY instead of the idiotic object.
( run in 0.518 second using v1.01-cache-2.11-cpan-39bf76dae61 )