"be consistent" | |
PerlMonks |
Re: printing contents of a hashby davido (Cardinal) |
on Apr 05, 2021 at 15:57 UTC ( [id://11130849]=note: print w/replies, xml ) | Need Help?? |
I guess we can assume that the code you posted takes place inside a subroutine, otherwise the return would be pointless. Your subroutine returns a reference to a hash. So to print it, you'll need to dereference. Assume your subroutine is named mysub:
...or...
There are lots of other ways, but these are two that will work well for simple hashes. If your hash contains references to other entities, the solution will become more complicated. If all you want to do is just visualize the data structure, use Data::Dumper:
Read below if you want to know how your post came to be nicely formatted: I edited your post, which had only raw text, no formatting such as <p>...</p> or <code>...</code>:
To it, I added paragraph and code tags anywhere you had either a line break or code:
Now your post is legible. You can read how to do this at Writeup Formatting Tips. Dave
In Section
Seekers of Perl Wisdom
|
|