The stupid question is the question not asked | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
You mentioned having trouble "figuring out how to access information from a hash nested within another hash", and asked for an example. Once you learn this syntax, you'll be wanting to use it all over the place. For purposes of a concrete example, say you have a hash of users. Their usernames are keys, but the values are hash refs with additional information. It would look something like this (written here by hand, but not too different from a Data::Dump output):
Note that the "groups" key refers to an array reference with the groups the user belongs to. Here are some examples of accessing the various data:
As for how to dump the data, Data::Dump gets my vote, most often anyway. I have some local debugging libraries that do various other data munging tasks to create more concise dumps in certain cases, but 99% of the time I could live with Data::Dump. It not being core doesn't concern me because none of the dump() calls survive to production code in my case.
use strict; use warnings; omitted for brevity.
In reply to Re: Data Dump / Tool To View Hash Structure Easily?
by rjt
|
|