#!/usr/bin/perl use lib '/home/slowtwitch/slowtwitch.com/cgi-bin'; # The CGI.pm module is by far the best CGI module for Perl use CGI qw(:standard); # This library keeps me honest and enforces rules I need to # to follow, ESPECIALLY for mod_perl use strict; # Disables strict referencing... Gotta do this to allow # package-based config file no strict 'refs'; # Ah yes... The wonderful Spindex configuration and # search routine modules themselves. :) use Spindex::config; use Spindex::search; # Yes it is lame- Deal with it. :) my $VERSION="4.1.5"; #Globally define the "return sequence" my $RET="\n"; #Let's fix the time so mod_perl works ok... :o) $^T=time; # Invoked by 'Print_Page' when it happens upon an HTML # comment in a template. # Syntax: Handle_Comment($cgi-process,$line-with-a-comment); sub Handle_Comment { my($cur,$cline)=@_; # Make sure it is a real comment, all on one line # and strip out the innards (shoving the real comment into $1) if($cline =~ //) { my $comment=$1; $comment =~ s/\s//g; # strip all whitespace # COMMENT DISPATCH TABLE if($comment =~ /(.+)RESULTS(.+)/) { # Ok, put the results here, formatted as # requested. my $sf=$1; # opening formatting my $ef=$2; # ending formatting for(Handle_Submission($cur)) { print "$sf$_$ef$RET" } } #endif } #endif } #end Handle_Comment # Print a Spindex template page # Syntax: Print_Page($cgi-process) sub Print_Page { my $cur=shift; # Open the normal template unless(-e "$templateFile") { die "File does not exist: $templateFile\n"; } open(TEMPL,"<$templateFile") or die "Cannot open $templateFile.\n"; # Spit the expiration jazz to the browser to control # content caching. NOTE: Usually ignored by IE. :( print header(-expires=>"$expire"); while() { my $tline="$_"; # Print the line to the browser, or else handle # it as a comment unless($tline =~ /