|Syntactic Confectionery Delight|
Data::Dumper issueby jesuashok (Curate)
|on Jun 07, 2006 at 15:32 UTC||Need Help??|
jesuashok has asked for the
wisdom of the Perl Monks concerning the following question:
I have encountered a situation where the output of Data::Dumper cannot be incorporated in a script to restore the original data, specifically where a string contains the sequence ^M^J and $Useqq is unset. (Note: this arises in my work because I have packed numbers in a large data structure, and on a few occasions the packed sequence happens to include ^M^J as a subsequence.)
The issue arises because perl seems to have a "friendly" way to handle DOS files on Unix platforms. My guess is that at a really early stage of reading the script file, ^M^J is translated to ^J, presumably before perl is even parsing the input. Obviously, it is ignoring the single quotes in this example, since the single quotes should suppress any interpretation of the input. (Note that I realize this is generally a desirable behaviour, so I think the bug is with Data::Dumper, not with how files are read.)
Note also that, as my script shows, this is not a problem when we use eval on the output of dump, but only when the code is saved to a file a compiled back from the file. (Unfortunately for me, I wish to save the dump to a file for frequent reuse, so that doesn't help me much...)
Out put is as follows :-
what is the problem when $Useqq = 0. It seems, that does not work as expected.
your thoughts on the same.
"Keep pouring your ideas"
2006-10-16 Unapproved by planetscape once evidence of habitual plagiarism uncovered.