Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re: What is the best way to dump data structures to logfiles?

by jettero (Monsignor)
on Mar 13, 2007 at 18:01 UTC ( #604633=note: print w/replies, xml ) Need Help??

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.


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!

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://604633]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (3)
As of 2022-08-09 08:11 GMT
Find Nodes?
    Voting Booth?

    No recent polls found