in reply to Parsing CSV into a hash

here's a (untested) solution using Text::CSV .. what modules did you try? if you show your attempts w/specific modules (maybe as separate posts), we can probably help with them..
my $data = {}; use Text::CSV; my $csv = Text::CSV->new(); open FILE, "foo.txt"; # open a file my $line = <FILE>; # get the header line $line =~ s/^#//; # strip off leading # $csv->parse($line); # parse line ... my @cols = $csv->fields(); # ... storing column name +s while(my $line = <FILE>){ # loop through rest of file $csv->parse($line); # parse line ... my @vals = $csv->fields(); # ... getting the values # my %row = map { $cols[$_] => $vals[$_] } 0 .. $#cols; # and hashi +ng up based on col names # $data->{ $row{ $cols[0] } } = \%row; # stick this hash into big + data structure. # NOTE: it's hashing on th +e first column.. # might want to change if +necessary # UPDATE: just use a hash slice: @{ $data->{ $row{ $cols[0] } } }{ @cols } = @vals; } close FILE; # close file -- all done!