Indeed, Data::Dumper will do. Data::Dump sometimes prints more compact results. Both output formats can be customized to suit your taste, but since this appears to be just debug print you need, the above will probably fit the bill.

You can always roll your own, too, although I'd suggest you think twice or more before you go to a lot of work.

#!/usr/bin/env perl use 5.014; use warnings; use Data::Dump; use Data::Dumper; my @hash_array = map { gen_hash() } 1..10; dd @hash_array; # Dumper(\@hash_array); # Generate a hash ref with some junk in it, two levels deep sub gen_hash { my $h; $h->{int rand 1000}->{int rand 1000} = int rand 1000 for 1..10; return $h; } __END__ Output: ( { 148 => { 570 => 799 }, 279 => { 679 => 288 }, 289 => { 2 => 464 }, 524 => { 501 => 746 }, 527 => { 122 => 839 }, 574 => { 924 => 173 }, 607 => { 295 => 240 }, 662 => { 163 => 277 }, 664 => { 157 => 606 }, 686 => { 32 => 425 }, }, { 232 => { 321 => 314 }, 358 => { 555 => 596 }, 365 => { 116 => 170 }, 579 => { 536 => 659 }, 693 => { 540 => 254 }, . . .

In reply to Re: Array of Hashes by rjt
in thread Array of Hashes by SuzuBell

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.