in reply to Search engine
foreach $i (keys %Index_db) { if ($i == $id) { @fileId = split( /:/, $Index_db{$i}); . . . } }
Why are you iterating over the keys of this hash? surely you should just do:
$id = $Words_db{$word}; @fileId = split( /:/, $Index_db{$id});
And that would have the same effect in a much shorter time.
Why do you have two hashes if the first only holds an index into the second. Reading over this it looks like you were previously using an array for Index_db, and that the hash held the array index where you could find the information. I think you should look at the code again as you can probably do without the Words_db hash, and clean up the logic to exploit the hash you are using.
Nuance
|
---|
Replies are listed 'Best First'. | |
---|---|
RE: RE: Search engine
by larsen (Parson) on Aug 01, 2000 at 17:41 UTC | |
by nuance (Hermit) on Aug 01, 2000 at 17:45 UTC |
In Section
Seekers of Perl Wisdom