SPUG: Search me...
otter101 at hotmail.com
Thu Jan 6 15:39:21 CST 2000
Well, this is getting interesting...
OK, a while ago I asked what was an alternative way of preventing
duplicates from piling up as a result of using grep() on an array for
several words. I was told that using a hash was such a way, and it works,
Its in an ASCII flat-file database, and only certain fields of the
record are to be searched. I would be using the record ID as the hash key,
since its an absolutely unique identifier for any record. The record ID is
at the end of the record, so I could actually use a substr() method for
getting the name for the hash key. Is there a way (if you know the symbol
for the field separator) to be able to skip areas of the record without
breaking it apart via split(), or would I have to break the record apart,
join only the fields to be searched, and then run the grep()?
I need to know at any time how many matches have in fact been processed
so I can stop the results list from becoming too large. If I use a hash, can
I use something like $#keys to find out how many keys have been registered
for this search pass so I know whether or not to continue the search?
I do so like talking in a group where the average IQ is well over a
Be seeing you...
Get Your Private, Free Email at http://www.hotmail.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
POST TO: spug-list at pm.org PROBLEMS: owner-spug-list at pm.org
Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/
SUBSCRIBE/UNSUBSCRIBE: Replace ACTION below by subscribe or unsubscribe
Email to majordomo at pm.org: ACTION spug-list your_address
More information about the spug-list