Subject: | Error in Data::Dumper serialization |
If the Data::Serializer::Data::Dumper bridge tries to serialize a scalar then the resulting deserialization is often wrong. For example, try this simple test:
use Data::Serializer;
my $str = '{foo=>"bar"}';
my $s = Data::Serializer->new(serializer => 'Data::Dumper');
print $str, "\n";
print $s->deserialize($s->serialize($str)), "\n";
Actual results:
{foo=>"bar"}
HASH(0x185487c)
Expected results:
{foo=>"bar"}
{foo=>"bar"}
I believe the flaw is the line
return $val unless ref($val);
which is returning the scalar as a literal instead in a serialized form. I did not find a similar error in the other bridges, just in Data::Serializer::Data::Dumper
-- Chris