rsiedl has asked for the wisdom of the Perl Monks concerning the following question:
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:
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?# Do some matching foreach my $auth_id (keys %authors) { foreach my $mid (keys %authors) { print "$authors{$auth_id}{'author'} \t matches \t $authors{$mi +d}{'author'}\n" if ( &matchme( $authors{ $auth_id}, $authors{$mid} ) +); } # end-foreach } # end-foreach sub matchme { # return true for a match otherwise false. } # end-sub
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Methodology for matching in hashes
by rodion (Chaplain) on Jul 13, 2006 at 01:59 UTC | |
|
Re: Methodology for matching in hashes
by Dervish (Friar) on Jul 13, 2006 at 05:06 UTC | |
|
Re: Methodology for matching in hashes
by NiJo (Friar) on Jul 13, 2006 at 19:22 UTC |