[sf-perl] Learning CGI with Perl

David Fetter david at fetter.org
Fri Mar 2 13:55:05 PST 2007


On Thu, Mar 01, 2007 at 07:29:26PM -0800, Neil Heller wrote:
> 
> 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.

I think you should probably pick up a more recent book on this, as
hand-tooling HTML headers went out with the 90s.  At least check out
CGI.pm and its successors :)

Cheers,
D
> 
> 
> #! 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
> 
> 
> 
> _______________________________________________
> SanFrancisco-pm mailing list
> SanFrancisco-pm at pm.org
> http://mail.pm.org/mailman/listinfo/sanfrancisco-pm

-- 
David Fetter <david at fetter.org> http://fetter.org/
phone: +1 415 235 3778        AIM: dfetter666
                              Skype: davidfetter

Remember to vote!
Consider donating to PostgreSQL: http://www.postgresql.org/about/donate


More information about the SanFrancisco-pm mailing list