my @fieldnames = qw(Lname Fname ssn address city state zip phone1 phone2); my %row; @row{@fieldnames} = split(/,/, $line); # yeah, I just told you to use Text::CSV, but I'm keeping my suggestions independent.