while () { chomp; my @line = split /,\s*/; my $key = shift @line; push @{$data{$key}}, \@line; } print $data{"Andrea"}[0][1], " should be good\n"; # offsets off by one print $data{"Dave"}[0][1], " should be better\n"; print $data{"Joe"}[0][1], " should be 0\n"; __END__ Andrea, 6, good, nice, 3 Bill, 5, 4, better, 5, 7, 4 Clark, 4, 5 Dave, best, better, best Joe, 5, 0 Joe, 4, 6 William, 6, 7, 8, 3 , 1 ,5 Andrea, 45, bettr, best, 6