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
-
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.