Hi, This works, even if it's not the most elegant. open LIST, "<mail.txt" or die "cannot open mail file"; while (my $line = <LIST>) {
@details = split /\s+/, $line; if (@details == 5) { #test for length of array $details[2] .= " "; $details[2] .= $details[3]; #put middle name in with 1st name splice @details, 3, 1; #get rid of unwanted middle name field } push @list, [@details]; #make array of arrays. } foreach (@list) { foreach (@$_) { print "$_:" } print "\n"; } -- Dr Richard Adams Chromosome Structure Group Room 6.37, Swann Building ICMB, University of Edinburgh Kings Buildings, Mayfield Rd, Edinburgh EH9 3JR UK Tel 44 131 650 7102 Fax 44 131 650 7028 Email [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]