Name reg score1 score2 score3 score4 a 1 2 3 3 4 b 2 4 5 6 7 c 3 5 6 7 9 d 4 6 0 2 8 e 5 0 9 5 3 #### while () { ($1, $2, $3, $4, $5, $6) = split; $hash{$1} = [ $2, $3, $4, $5, $6 ]; } # or, alternatively, a hash of hashes: $hash{$1} = { reg => $2, score1 => $3, score2 => $4, score3 => $5, score4 => $6 }; # thus, score3 can be found as such: $hash{a}->[3]; # or with the other method: $hash{a}->{score3};