develooper Front page | perl.beginners | Postings from May 2007

accesing a hash of an array of hashes

Thread Next
May 26, 2007 09:20
accesing a hash of an array of hashes
Message ID:
ive read a load of data in  from a CSV file with Text::CSV and ended
up with a hash (%hash) where the keys are the column labels.
my  @headings=split(/,/,$rows[0])
and then

for (my $j=1;$j<$#rows;$j++)
my $status  = $csv->parse ($rows[$j]);   # parse a CSV string into
my @columns = $csv->fields ();           # get the parsed fields

for (my $i=0;$i<$#columns;$i++)

I want to  process the data once its grouped by the date field present
in $hash. So i think I want a hash of dates  where the key is that
date field
I  push onto the value the hashes of the records that contain the date

push @{$Hofdates{$hash{DATE}}},\%hash;

but im having a problem working out how to access the  individual
items in the  hashes that are elements of the array

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About