in reply to Re: trying to print hashes with mixed results
in thread trying to print hashes with mixed results

Sure that will work , but just from a learning standpoint how could I get that loop work and print the values?
  • Comment on Re^2: trying to print hashes with mixed results

Replies are listed 'Best First'.
Re^3: trying to print hashes with mixed results
by Fletch (Bishop) on Apr 09, 2021 at 02:39 UTC

    From your output you are; it's just the values are themselves hashrefs. You'd need to then iterate over those in turn. The simplest solution is going to be to use Data::Dumper (or YAML::XS or JSON::PP or . . .).

    The cake is a lie.
    The cake is a lie.
    The cake is a lie.

Re^3: trying to print hashes with mixed results
by LanX (Saint) on Apr 09, 2021 at 03:05 UTC
    > but just from a learning standpoint how could I get that loop work and print the values?

    you are looping over a hash-ref and $v is another hash-ref, again.

    so start another loop over $v.

    In the general case you'll need a recursive function which loops over hash-refs and array-refs.

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery

Re^3: trying to print hashes with mixed results
by haukex (Archbishop) on Apr 09, 2021 at 06:41 UTC
    Sure that will work , but just from a learning standpoint how could I get that loop work and print the values?

    See Hashes of Hashes in perldsc.