Search for '{{search_term}}'

Pretty printing complex data structures in Ruby - like Data::Dumper in Perl

CMOS is the Code-Maven Open Source podcast that also includes video interviews. Subscribe to this feed RSS feed with your Podcast listener app or via iTunes iTunes.

Creating complex data structures (hashes of hashes of arrays of hashes of arrays....) is easy in Ruby.

Unedrstanding what we have on our hand can be a bit more difficult.

Perl has a build in modules called Data::Dumper that can be used to pirnt complex data structures, for example when debugging Perl programs.

Ruby has pp, the Pretty Printer for the same purpose.


In the comments, please wrap your code snippets within <pre> </pre> tags and use spaces for indentation.
comments powered by Disqus