I fixed your code below. You were very close. Always use strict; and use warnings;.

I also showed 2 popular ways of having Perl dump the structure for you. Data::Dumper is a CORE module and will always be available. Data::Dump will usually be available. Note that pp outputs to stderr and so I had to turn the buffering of stdout off in order for the printout to come out in the expected order.

use strict; use warnings; use Data::Dump qw(pp); use Data::Dumper; $|=1; #turn off stdio buffering my %HoH = ( "2023-01-01" => { "00:00" => 1234, "01:00" => 789, "02:00" => 456, }, "2023-02-01" => { "00:00" => 4321, "01:00" => 987, "02:00" => 654, },); for my $dia (sort keys %HoH){ print "<br>$dia: \n"; for my $horarios (sort keys %{$HoH {$dia}}){ print "$horarios=>" . $HoH{$dia}{$horarios} . "\n"; } } print "VALUE:<br>"; print $HoH{"2023-01-01"}{"00:00"}; #I couldn't see the value print "\n\n"; pp \%HoH; print "\n\n"; print Dumper \%HoH; __END__ Prints: br>2023-01-01: 00:00=>1234 01:00=>789 02:00=>456 <br>2023-02-01: 00:00=>4321 01:00=>987 02:00=>654 VALUE:<br>1234 { "2023-01-01" => { "00:00" => 1234, "01:00" => 789, "02:00" => 456 }, "2023-02-01" => { "00:00" => 4321, "01:00" => 987, "02:00" => 654 }, } $VAR1 = { '2023-02-01' => { '01:00' => 987, '02:00' => 654, '00:00' => 4321 }, '2023-01-01' => { '00:00' => 1234, '02:00' => 456, '01:00' => 789 } };

In reply to Re: Print %HoH values by Marshall
in thread Print %HoH values by seafree

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.