database searching in perl4- ....
hi. I'm having trouble searching my database in perl. basically what I've
got is an indexed database, which I want to search with variables I
get from somewhere else.
so, my database may be
computer:1:4:7:6
screen:4:7:6:1
keyboard:6:4:7:1
desk:1:7:6:4
the field names are hardware:owners:service_month_code:location_code:services
when I look for say anything which has been serviced once, I wanna return
screen and keyboard, where a search (/1/) would return all of them. I'm
not fantastic at perl (as you can guess as I know this is a pretty simple
problem) but I'm having real trouble.
the real database has 37 fields, occurs on one line, and the whole record
is to be returned. It doesnt have to keep searching the record for more matching
variables when it finds one in a record, and if the variable is "^" then it
reads that as an empty variable. It has to count the number of hits and
stop when it hits a vertain number which is passed to it as $index{'maxhits'}.
Any help would be appreciated.
Max