As ever, there's a lovely little module on CPAN that does this - Lingua::EN::MatchNames. It uses Lingua::EN::NameParse, Lingua::EN::Nickname etc. to split up the name, check for variants etc., and returns a (fairly arbitrary, but seems pretty accurate) percentage match. Very handy for cleaning up contacts databases...