From: Josef Wolf Date: 2009-09-04T00:40:10+09:00 Subject: Re: Data::Dumper for Ruby? On Fri, Sep 04, 2009 at 12:04:30AM +0900, Gregory Brown wrote: > On Thu, Sep 3, 2009 at 11:00 AM, Josef Wolf wrote: Thanks for the fast answers! >> One of the first things I am missing is something like perl's Data::Dumper >> module. �This module is able to take a (nested) data structure and dump it >> in perl syntax. > > Do you actually need the syntax preserved, or are you just trying to > serialize data? The purpose is to check whether the data structures I have built (or am about to build) are how they should be. So the important thing here is that it is easy to grasp visually. > If the latter, use Marshal or the YAML std library, or consider JSON > (standard in 1.9, a gem in 1.8) I know YAML, and I actually use it a lot for configuration or persistent storage. But I find YAML somewhat hard to read and understand when the data structures start getting complicated. With output from Data::Dumper, you fire up emacs to easily find matching scopes.