diyaz has asked for the wisdom of the Perl Monks concerning the following question:
I don't have an issue assigning the hash and using Data::Dumper I see that z is a reference. However, I cannot seem to retrieve the array to manipulate. Say I wanted to print each element in this array:$lengths{$line}= {x=> $site[0], y=>$site[1], z=> \@data};
This gives me nothing. Is it because I am forcing scalar? Sample output from Data::Dumperfor my $coord (keys %lengths) { for (@{$lengths{$coord}{z}}) { print "$_\n"; } }
edit: forgot the sigil thanks.$VAR57 = '10:36759286'; $VAR58 = { 'reads' => $VAR2->{'reads'}, 'x' => '10', 'y' => '36759286'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Help with array ref in hashes
by kennethk (Abbot) on Jan 09, 2015 at 21:26 UTC | |
|
Re: Help with array ref in hashes
by toolic (Bishop) on Jan 09, 2015 at 21:23 UTC | |
|
Re: Help with array ref in hashes
by AnomalousMonk (Archbishop) on Jan 09, 2015 at 21:45 UTC | |
by diyaz (Beadle) on Jan 12, 2015 at 15:28 UTC |