Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

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.

-Paul


Comment on Re: What is the best way to dump data structures to logfiles?
Download Code
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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2014-09-21 11:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (168 votes), past polls