#!/usr/local/bin/perl use CGI; $WAISDIR="/usr/local/home/alex/cvs/alex/MPC-OS/docs/www/waissrc"; $HEADER=`/bin/cat /usr/local/home/alex/cvs/alex/MPC-OS/docs/www/header.html`; $FOOTER=`/bin/cat /usr/local/home/alex/cvs/alex/MPC-OS/docs/www/footer.html`; $START=`/bin/cat /usr/local/home/alex/cvs/alex/MPC-OS/docs/www/start.html`; $STOP=`/bin/cat /usr/local/home/alex/cvs/alex/MPC-OS/docs/www/stop.html`; print "Content-type: text/html\n\n"; $query = new CGI; $str = $query->param('searchstring'); $str =~ s/[^a-zA-Z0-9- ]//g; $str =~ s/ -/ /g; $str =~ s/^-/ /; print "$START\n$HEADER\n"; print '

Search result for query "'.$str.'"

'; open RESULT, "/usr/local/bin/waisq -f - -g -s $WAISDIR -S mpc.src -g $str | grep :headline |"; print ''; print "
";
$cpt = 0;
while () {
    chop;
    m/^#/ && next;
    m/:headline "(.*) (.*)"/ && do { $file = $2.$1; };
    $file =~ s%.*cvs/alex/MPC-OS/docs/www%%;
    $cpt++;
    print '
'; } close(RESULT); print '
'.$cpt.'- http://mpc.lip6.fr'.$file.'

Search:
'; print "$FOOTER\n$STOP\n"; __END__