http://qs321.pair.com?node_id=604633


in reply to What is the best way to dump data structures to logfiles?

I think Data::Dumper is fine for every day purposes. It's pretty fast. My guess is the object oriented interface would make things more log friendly. Also $Data::Dumper::Indent=0 to keep it all on one line.

You might also look at JSON, which may have a way to do single line things, and if that (staying on one line I mean) isn't a concern you might even look at YAML::Syck. It's supposed to be pretty fast, since it uses a c library for ... something.

-Paul

Replies are listed 'Best First'.
Re^2: What is the best way to dump data structures to logfiles?
by monsieur_champs (Curate) on Mar 14, 2007 at 10:13 UTC

    Dear Paul
    I don't think that changing notation will result in solving my problem. Having a pretty printer for generic data structures in Perl should do the trick, and, as far as I am concerned, things could become nasty when I try to explain operations fellows that they will see data in a format that is not perl anymore, but isn't also "pure data", but another programming language. That's possibly too much information for them.

    BTW, thanks for you interest. The tip about YAML::Syck looks interesting and I will try to study a bit more the issue before saying something.

    Thank you!