#!/usr/bin/perl ############################################################################################ # Change the first line of this file if the path to your perl is not /usr/bin/perl # Example: #!/usr/local/bin/perl ############################################################################################ # NPH cgi script wrapper for this web application. Can send full http response header. # Author: Daniel Dinev; All rights reserved (c) 2001; http://www.chatologica.com/ ############################################################################################ use strict; # make Perl more strict to code $^W = 1; # enable warnings $| = 1; # do not buffer the script output BEGIN { # Now making the current working directory to be the directory where this script resides. # This is needed usually if the web server is IIS on Windows platform! my $path = $0; # $0 is the full path to this script if($path =~ m{^(.*)[/\\][^/\\]+$}) { # remove script filename from the path $path = $1; chdir($path) || # move to the directory of this file print "HTTP/1.0 200 OK\nContent-type: text/html\n\nCan't navigate to '$path' directory: $!"; }; }; use lib qw(.); use MTS4::STD::MyCarp; # make error messages appear in the browser window use MTS4::STD::CGI_Request; my $r = new MTS4::STD::CGI_Request(nph => 1); $r->process; # process this cgi request