searchfork module Takes CGI data about searches and forks as appropriate start routine Manages forking, communication between parent and child processes Input: None Output: None Uses: IO::Handle, Search_Broker PDL Set up PARENT, CHILD handles Foreach location which is a key in locationlist hash If process is child Close PARENT Call child routine to get search results for this location Print XML search results to CHILD (goes to parent's PARENT) Close CHILD Exit 0 (Process is parent) Close CHILD Set restext from input to PARENT (from a child's CHILD) Call parent routine to set locresults hash Foreach pid in children list Wait for exit child routine Carries out child activities Input: locationid,search protocol, search data as hash Output: results as reference to array of hashed results PDL If protocol="rdb" Call rdbsearch routine to set results Else Set querystring="" For i=1..3 Set text=searchdata{text[i]} If i>1 Next if text="" Set ops=searchdata{ops[i]} Append ops to querystring Substitute wild cards in text if protocol="z3950" Append appropriate data to querystring depending on searchdata{fields[i]} Append appropriate data to querystr if type != "any" Call Search_Broker->new to create search results Call Search_Broker->search to carry out search Return results parent routine Carries out parent activities Input: results XML Output: reference to array of hashed search results PDL Call ParseXML routine to parse results Foreach location in parsed results Call ParseXML routine to parse the data per location Set location_id,locreslist with search results from this data Foreach result in locreslist Set reshash empty if result is not XML-like Else Call ParseXML routine to parse the result Set information in hash of processed results Add processed results to results list Return results list