Method #2 #!F:\Perl_program\perl\bin\perl -w #I am using Portable Strawberry PERL on Windows XP. use strict; use warnings; use DBI; open FINAL, "completed.csv" or die(); our %hash1; our %hash2; while () { our ($username, $date_modified) = split; $hash1{$username} = $date_modified; } while () { our ($fullname, $branch) = split; $hash2{$fullname} = $branch; } if (our $username = our $fullname){ print OUTFILE "$username $hash2{$fullname} $hash1{$username}\n"; } close FINAL; close HCDIR; close OUTFILE;