Hi people,

Okay I think this a fairly basic concept but I promise you I have done my research prior to posting here but I'm still hopelessly lost!

I've looked at the following posts: How do I make a hash of arrays?, Making a Hash of Arrays, How do I refer to an element of a hash of arrays as an array?

I create my array with...

foreach $line (readline FNAME){ @data = split /\t/, $line; foreach $bit (@data){ $bit = removeWhiteSpace($bit); } $id_veritasHash{$count} = \@data; $count ++; }

...and I try to display the array with..

while ( ($key, @value) = each %id_veritasHash){ foreach $temp (@value){ print "$key, $temp\n"; } }

But this just gives me (well I think it is anyway) an array reference...

13, ARRAY(0x121654) 7, ARRAY(0x121654) 5, ARRAY(0x121654)

Please can someone help me here I don't understand whats wrong!

Thanks in advance

M


In reply to Hash of arrays by heezy

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.