heezy has asked for the wisdom of the Perl Monks concerning the following question:
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
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Hash of arrays
by FamousLongAgo (Friar) on Oct 27, 2002 at 18:30 UTC | |
Re: Hash of arrays
by grantm (Parson) on Oct 27, 2002 at 19:09 UTC | |
by heezy (Monk) on Oct 27, 2002 at 20:13 UTC | |
Re: Hash of arrays
by tadman (Prior) on Oct 27, 2002 at 20:16 UTC | |
by heezy (Monk) on Oct 28, 2002 at 16:03 UTC |
Back to
Seekers of Perl Wisdom