in reply to Data Dumper not outputting valid perl?

are you sure Data::Dumper is producing that broken code, or perhaps is it producing correct code and it's getting screwed up when you put it into the database. are you using placeholders for your DBI inserts or do you have some custom quoting routine which may somehow be deleting the quotes in the name of "security"?

ie, does your SQL look like:

INSERT INTO foo_table (stuff) values (?)

or,

INSERT INTO foo_table (stuff) values ($string)

if it's the latter, i have a strong suspician that that is related to your problem.

posting the code which generates that string and then inserts it into the database would help us diagnose things.

anders pearson