BW
Main Menu
Home
AMTP
Bio
Hire Bill
Bill’s Music
BW Whois
Boulder Pledge
UBE-Related
Blog
CGI Scripts
CMS Project
Music DB
Creative HTML
The CGI Book
Perl Book
BillyDos
Privacy
Newsletter
Contact Bill
The End
· Sponsors ·
amazon.com
Personal Loans Online
Names Database
Google Optimization
Free Credit Score
Learn Programming
Live Music
Rheumatoid Arthritis
Mortgage Leads
Payday Advance
Debt Consolidation
Bad Credit Loans
Mortgage Refinance
Newsletter Delivery
Mobile Ringtones
Home Loans
Netflix DVD Rentals
Site Design: Bill Weinman
© 1995-2008
W.E. Weinman

CGI Scripts by Bill Weinman

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";
Lawyers should advertise on hospital ceilings.
·/.