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. #### my $user = substr($Fname, 0, 1) . substr($Lname, 0, 3) . substr($ssn, -4);