in reply to Methodology for matching in hashes

I suggest going canonical. You decide (or decide, try and decide again) what things are equivalent, and generate a function to transform all names into a canonical form. If two names colapse onto the same canonical form, then they are at least probably equivalent. If needed, you can then do whatever further tests on the probable matches to find the ones that are definite matches.

In your example, the canonical() sub would maybe replace hyphens in last names by spaces, and eliminate the last initial. The sub doesn't need to return just one cannonical form either, it can return an array of them for different types of matches.

Once you've done that the rest is fairly strightforward.

while ($name = shift @inp_names) { for $canon ((canonical($name))) { #extra parens force list # add $name to an anon array, stored under the $canon key push @{$possible_matches{$canon}}, $name; } } for $canon (keys %possible_matches) { print "matches under $canon= ", join(',', @{$possible_matches{$canon}}) "\n"; } # for illustration. untested
Hope this serves to get you started. Happy matching.