in reply to Search Categories - Most efficient way
Load your search criteria into a hash. Load each record into a hash. Then, to see if a record matches, do
What this doesn't handle is a search for a 35-45 year old single women in Silicon Valley who appreciates gearheads. Fortunately, I married one.$match = 1; foreach $key ( keys %search ) { $match = 0, last if $record{$key} ne $search{$key}; } if ( $match ) { printresults($record); }
|
|---|