Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

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


In reply to Hash of arrays by heezy

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?

What's my password?
Create A New User
Domain Nodelet?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2023-02-07 12:22 GMT
Find Nodes?
    Voting Booth?
    I prefer not to run the latest version of Perl because:

    Results (39 votes). Check out past polls.