Re: [htdig] Running htsearch from perl script


John Grohol PsyD (johngr@cmhcsys.com)
Fri, 18 Jun 1999 13:53:50 -0400


I found something like this to work:

# Set the environmental variables

$ENV{'REQUEST_METHOD'} = 'GET';

if (not($page)) {
$ENV{'QUERY_STRING'} = "config=$config&restrict=$restrict&exclude=$exclude&words=$squery&method=$method&format=$format";
        } elsif ($restrict) {
$ENV{'QUERY_STRING'} = "config=$config&words=$squery&restrict=$restrict&method=$method&format=$format&page=$page";
        } else {
$ENV{'QUERY_STRING'} = "config=$config&words=$squery&method=$method&format=$format&page=$page";
}

system("$dir/htsearch");

At 03:10 PM 6/18/99 -0400, Krishna wrote:
>
>Hello,
>
>I am trying to write a perl scrit that will execute htsearch.
>The problem i am having is , htsearch doesn't "see" the variable that
>is set by the script.
>
>When trying to execute the other program the environment is set
>correctly.
>
>What am i doing wrong ?
>
>The example below will always return:
>"no matches were found to "".
>
>i.e none of the env. parametrs are set correctly!
>
>#!/usr/bin/perl
>$ENV{restrict}="";
>$ENV{exclude}="";
>$ENV{words}="test";
>$ENV{method}="or";
>$ENV{config}="htdig";
>$ENV{format}="long";
>$ENV{lmatchesperpage}="15";
>system "htsearch";
>
>
>Thanks
>krishna
>
>------------------------------------
>To unsubscribe from the htdig mailing list, send a message to
>htdig@htdig.org containing the single word "unsubscribe" in
>the SUBJECT of the message.
>
>
------------------------------------
To unsubscribe from the htdig mailing list, send a message to
htdig@htdig.org containing the single word "unsubscribe" in
the SUBJECT of the message.



This archive was generated by hypermail 2.0b3 on Fri Jun 18 1999 - 10:12:28 PDT