in reply to trying to print hashes with mixed results

You could use Data::Dumper ...

use Data::Dumper; ... while( my ( $k, $v ) = each %hash ) { print Dumper( { qq[error:$k] , $v } ); }

Replies are listed 'Best First'.
Re^2: trying to print hashes with mixed results
by merrittr (Novice) on Apr 09, 2021 at 02:36 UTC
    Sure that will work , but just from a learning standpoint how could I get that loop work and print the values?

      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.

      > 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

      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.