|
|
| Perl: the Markov chain saw | |
| PerlMonks |
Methodology for matching in hashesby rsiedl (Friar) |
| on Jul 12, 2006 at 20:56 UTC ( [id://560850]=perlquestion: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.rsiedl has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks, I'm after a bit of advice/suggestions on how to best achieve the following: I have a list of names + initials that I pull from a database and want to check to see if there could be similar names in the db... smith j could match smith jn mayer-handel c could match mayer handel c jones t jnr could match jones t etc...I can only think of two methods for doing this: 1. do a select using mysql - my problem here is i dont know how to do such a complex select (or even if it could be done) 2. select all names, store them in a hash and then foreach author scroll through the hash running a "match sub" on each name to see if it matches 2 doesnt seem like the most efficient way of doing things, (10 000 records = 100 000 loops) so I was after any other ideas about the path to take? Any help would be appreciated. Cheers, Reagen
Back to
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||||