local %DATAHASH; open (DATA, 'foo.csv'); while (){ chomp; my @datarow=split(/,/, $_); push(@{$DATAHASH{$datarow[0]}}, ($datarow[1])); }