sub to_yaml {
require YAML;
return YAML::Dump(shift);
}
sub to_json {
require JSON;
return JSON::encode_json(shift)
}
sub from_perl {
no strict 'vars';
my $data = eval shif
hift);
}
sub from_json {
require JSON;
return JSON::decode_json(shift);
}
my %tr_functions = (
ddumper => \&to_perl,
yaml => \&to_yaml,
json => \&to_json,
);
my %i_tr_func
tions = (
ddumper => \&from_perl,
yaml => \&from_yaml,
json => \&from_json,
);
# $g = tr_hash($h, $ctl) converts hashrefs to hashrefs
# $g = tr_hash($h, $ctl, 1) does the reverse co