From: Filippo A. S. <sal...@ry...> - 2002-07-29 19:30:10
|
Hi, I'm running htdig version 3.2 beta 3 on a solaris 8 Sun box, and I'm having trouble getting a wrapper script for htsearch to work properly. Here's the symptoms: If I run the script from a command line prompt, and REQUEST_METHOD is unset, then I get the right output. If I run the script thru http as a proper CGI, then it seems that htsearch does run, but I get no results. If I explicitly set REQUEST_METHOD to GET in the wrapper, then I get no sensible output at all (as if the wrapper weren't even running). The kicker is that under solaris 7 everything worked just fine. Here is the fragment of the wrapper that calls htsearch. NOTE: by the point this that this fragment runs, I've already done $ENV{'REQUEST_METHOD'} = 'GET'; Can anyone suggest what's wrong? my $c = "$htsearch -c $digconf words=$query | "; if (! open (IN, $c)) { Message (div ("Could not start htsearch.")); return 0; } Message (div ("STARTING SEARCH |$c|")); Message (div ("REQUEST_METHOD: ", $ENV{'REQUEST_METHOD'})); # SKIP THE MIME HEADERS, AND THE 'BLANK LINE' AFTER IT. readline <IN>;Message (div ("0: ", $_)); readline <IN>;Message (div ("1: ", $_)); # BY SETTING $/, WE READ INPUT IN CHUNKS SEPARATED BY BLANK LINES. # THAT IS, ONE READ == ONE ENTRY. local $/ = ""; while (<IN>) { $items++; if (/^Error/) { Message (div ($_)); close (IN); return 0; } elsif (/^result:/) { @results = (@results, $_); $found++; } else { # ASSUME THIS IS SOME HTML STUFF THAT SHOULD APPEAR IN THE OUTPUT. Message ($_); } } close (IN); Cheers. Fil Salustri -- Prof. Filippo A. Salustri, Ph.D., P.Eng. Department of Mechanical, Aerospace, and Industrial Engineering Ryerson University Tel: 416/979-5000 x7749 350 Victoria St. Fax: 416/979-5265 Toronto, ON email: sal...@ry... M5B 2K3 Canada http://deed.ryerson.ca/~fil/ |