snape has asked for the wisdom of the Perl Monks concerning the following question:
I was going through a snippet of code and I didn't understand the following notation (line 5 in the code below]. I am confused as how can a hash be represented as an array or is it a different form of hash of arrays or is array of hashes. The code is as follows:
my @Data; my @cols = qw(col1 col2 col3 col4); while (<STDIN>) { chomp; my %table; @table{@cols} = split /\t/; ## Explain push @Data, \%table; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Data Structure: HOA or AOH ??
by afoken (Chancellor) on Jan 30, 2010 at 22:27 UTC | |
|
Re: Data Structure: HOA or AOH ??
by Anonymous Monk on Jan 30, 2010 at 22:28 UTC | |
|
Re: Data Structure: HOA or AOH ??
by umasuresh (Hermit) on Jan 30, 2010 at 22:41 UTC | |
by ikegami (Patriarch) on Jan 31, 2010 at 17:18 UTC | |
by umasuresh (Hermit) on Jan 31, 2010 at 17:47 UTC | |
by ikegami (Patriarch) on Jan 31, 2010 at 17:53 UTC | |
|
Re: Data Structure: HOA or AOH ??
by umasuresh (Hermit) on Feb 01, 2010 at 20:07 UTC |