#loop through each big file once
#and check the client hash for a match
foreach my $rec (@$big_file) {
if($client{$rec->{lastname} . $rec->{phone}}) {
#we've got a potential match!
#now compare each individual field
if($client{$rec->{lastname}.$rec->{phone}}->{firstname} eq $rec->{firstname} && ...) {
#blah blah blah
}
}
}
#this way we're looping through the big files only once
#and doing a keyed in-memory search of the small file
#
#the other way around will loop through each big file
#5000 times.
Comment on Re: Optimise database searching currently using DBD::CSV