Think about Loose Coupling | |
PerlMonks |
Re: What is the best way to dump data structures to logfiles?by radiantmatrix (Parson) |
on Mar 14, 2007 at 20:13 UTC ( [id://604884]=note: print w/replies, xml ) | Need Help?? |
You really haven't given all your requirements here, so I apologize if this is a useless suggestion. I've had success using Data::Dumper or YAML (or its XS replacement YAML::Syck) to dump structures to a file, which is then referenced in the log file. I use a sub that looks something like:
And would be called something like:
The log line would look something like:
And the file "dump.foobar1" would contain the $foo_doer serialization. You can equally use Data::Dumper or any other serialization module you prefer using this model.
<–radiant.matrix–>
Ramblings and references The Code that can be seen is not the true Code I haven't found a problem yet that can't be solved by a well-placed trebuchet
In Section
Seekers of Perl Wisdom
|
|