Hi,

I came to a little problem trying to "thaw" a hash with storable. In
fact I'm somehow forced to use a hash that contains this serialised
(freezed) hash, and then pass it to XML::Simple as to make an xml
document with this.

So, what I do is something like

$parsedMsg->{'container'}->{'serialised'} = freeze(dclone($hash));
# after having set my parsing parameters in XMLin object:
$xmlString = XML::Simple::XMLin($parsedMsg);

Then, from the other side, I just do this:
$parsedMsg = XML::Simple::XMLout($xmlString);
$hash = thaw($parsedMsg->{'container'}->{'serialised'});


But that just creates a lot of errors.
In fact, the xml string is passed via a socket and everything, and I am
absolutely sure that everything else than the freeze, thaw and dclone
work very nicely cause I also tried it with just a string in the
"serialised" element (the string not being serialised this time) and it
works.

So, the problem, I think, is that the XML::Simple parser doesn't get
right xml cause there's a lot of funny characters introduced by the
serialisation. The errors I got are:

Use of uninitialized value in substitution (s///) at
/usr/share/perl5/XML/Simple.pm line 1016.
Use of uninitialized value in substitution (s///) at
/usr/share/perl5/XML/Simple.pm line 1017.
Use of uninitialized value in substitution (s///) at
/usr/share/perl5/XML/Simple.pm line 1018.
Use of uninitialized value in substitution (s///) at
/usr/share/perl5/XML/Simple.pm line 1019.
Use of uninitialized value in join or string at
/usr/share/perl5/XML/Simple.pm
line 1000.

But this doesn't really matter.

So here come my questions:
- Am I right guessing the "freeze" function gives a lot of funny
characters?
- What is the best solution? (make a formatting function to avoid funny
characters once serialised, use something else than freeze, or what?)


If you have any idea, that may help greatly,
Thanks,

Yannick


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to