http://qs321.pair.com?node_id=924923


in reply to Re^2: Hashes of Hashes of Arrays? Is it possible?
in thread Hashes of Hashes of Arrays? Is it possible?

You are overwriting your hash every time through the while loop. Move the declaration of the hash outside of the loop:
my $csv = Text::CSV_XS->new(); open (FILE, "<", "$tickdir/$file") or die "Can't open CSV File:$! +\n"; my %HOH; while (<FILE>) { $csv->parse($_); my @columns = $csv->fields(); my $key = str2time($columns[1].' '.$columns[2]); my (@prices, @volumes) = (); $HOH{$key}{"name"} = $columns[0]; push(@{$HOH{$key}{"price"}}, $columns[3]); push(@{$HOH{$key}{"volumes"}}, $columns[4]); print Dumper(\%HOH); } close FILE;