First, <code> tags in your posts will help monks interpret your code; see Markup in the Monastery

There are a number of typos in your posted code. As some of these would prevent the interpreter from running, I will assume some of them are from transcription. You do seem to suffer from some misconceptions regarding structures - please read perlref and perldsc. I have attempted to read your mind and fix the posted code - my frobnitz is on the fritz right now, so I can't guarantee this will do what you want.

use strict; use warnings; my %LkHigh; my %leakHigh; my @names = ('jim', 'john', 'joe'); my @values = (1, 2, 3); my @PartNums = ('A', 'B', 'C'); # Stage1 for my $i (0 .. $#names) { my $name = $names[$i]; my $value = $values[$i]; push @ { $LkHigh{$name}}, $value; # works! } #Stage2 for my $PartNum (@PartNums) { push @{$leakHigh{$PartNum}}, {%LkHigh}; } # when I try to print this I loose the $values in the hash array. # this is what I'm using to print foreach my $PTnum (keys %leakHigh){ foreach my $pin (0 .. $#{$leakHigh{$PTnum}}){ foreach my $i (keys %{$leakHigh{$PTnum}->[$pin]}){ print "@{$leakHigh{$PTnum}[$pin]{$i}} \n"; } } }


In reply to Re: hash of hash of array by kennethk
in thread hash of hash of array by hblanken

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.