Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Answer: How can I visualize my complex data structure?

( #823716=categorized answer: print w/ replies, xml ) Need Help??

Q&A > Data Structures > How can I visualize my complex data structure? contributed by Xiong

My personal favorite is Smart::Comments.

use strict; use warnings; # Enable special comments for debugging and reporting: use Smart::Comments; my $data_structure = { a => [ 1, 2, 3 ], b => [ { X => 1, Y => 2 }, { X => [ 1, 2, 3 ], Y => [ 4, 5, 6 ], Z => [ 7, 8, 9 ] }, ], }; # the following is a "smart comment" which causes a dump of the expres +sion, using Data::Dumper: ### $data_structure
Produces this output:
### $data_structure: { ### a => [ ### 1, ### 2, ### 3 ### ], ### b => [ ### { ### X => 1, ### Y => 2 ### }, ### { ### X => [ ### 1, ### 2, ### 3 ### ], ### Y => [ ### 4, ### 5, ### 6 ### ], ### Z => [ ### 7, ### 8, ### 9 ### ] ### } ### ] ### }

Smart::Comments does much, much more than this, too.

Comment on Answer: How can I visualize my complex data structure?
Select or Download Code
Re: Answer: How can I visualize my complex data structure?
by BioLion (Curate) on Feb 18, 2010 at 09:31 UTC

    I think i have a new favourite too...

    Just a something something...
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (10)
As of 2014-12-18 06:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (43 votes), past polls