[sf-perl] Learning CGI with Perl
Neil Heller
nheller at silcon.com
Thu Mar 1 19:29:26 PST 2007
I decided that I wanted to learn some CGI to go along with my Perl in a
Winderz environment. I bought what I had hoped was a good book but...
ActiveState Perl gagged on the first line of the program. The error message
was that if I used -T in the "#!" line then I needed to use it on the
command line. So I went to the command line and tried to start the prog
manually with -T as a command line parameter. From that I got the same
message.
Does anybody have an idea on how I can overcome this?
Better yet, can anyone suggest a good book for learning CGI?
FWIW, the name of the book is "CGI programming with Perl". The source code
follows.
#! perl -wT
print <<END_OF_HTML
content-type: text/html
<HTML>
<HEAD>
<TITLE>About this servr</TITLE>
</HEAD>
<BODY>
<H1>About this server</H1>
<HR>
<PRE>
Server name: $ENV(SERVER_NAME)
Listening on Port: $ENV(SERVER_PORT)
Server Software: $ENV(SERVER_SOFTWARE)
Server Protocol: $ENV(SERVER_PROTOCOL)
CGI Version: $ENV(GATEWAY_INTERFACE)
</PRE>
</HR>
</BODY>
</HTML>
END_OF_HTML
Neil Heller
nheller at silcon.com
More information about the SanFrancisco-pm
mailing list