in reply to Comparing two files

Well , your line:
$fullname =~ s/\s+/ /;
will only change the first whitespaces into ' ' !!!
You may want to change it to:
$fullname =~ s/\s+/ /g;
and try to change:
my ($lname, $fname) = split('\s+', $record[5]);
into
my ($lname, $fname) = split( /\s+/, $record[5]);
otherwise you split the string with "\s+" as a delimiter, not with ' ' !

Hope this helps..

----------------------------------- --the good, the bad and the physi-- -----------------------------------