test.cgi
This is a very simple script for testing a server's
CGI interface. By using a minimal script you can concentrate on
finding out what is required to run a Perl/CGI script on your server.
Here is the source code for test.cgi. Copy/paste this code into your
text editor, and make sure that the line
#!/usr/bin/perl -w
is the first line in the file.
#!/usr/bin/perl -w
# test.cgi by Bill Weinman [http://bw.org/]
# Copyright 1995-2003 William E. Weinman
# Free Softare: Use and distribution under the same terms as perl.
use strict;
use CGI;
my $q = CGI::Vars();
print "Content-Type: text/plain\n\n";
print "\n";
print "Versions:\n=================\n";
print "perl: $]\n";
print "CGI: $CGI::VERSION\n";
print "\n";
print "CGI Values:\n=================\n";
for my $k (sort keys %$q) {
print "$k [$q->{$k}]\n";
}
print "\n";
print "Environment Variables:\n=================\n";
for my $k (sort keys %ENV) {
print "$k [$ENV{$k}]\n";
}
print "\n";
|