Re: cgi programming in Perl
- From: "Mark Tarver" <dr.mtarver@xxxxxxxxxxxxxx>
- Date: 24 Nov 2006 00:19:45 -0800
thanks!
JT wrote:
On Nov 23, 5:45 pm, "Mark Tarver" <dr.mtar...@xxxxxxxxxxxxxx> wrote:
Hi,
I'm working from 'CGI Programming with Perl' from O'Reilly. I've
copied this program from the book.
#!/usr/bin/perl
print <<END_OF_HTML;
Content-type: text/html
<HTML>
<HEAD>
<TITLE> about this server </TITLE>
</HEAD>
<BODY>
<H1> About this Server </H1>
<PRE>
Listening on Port: $ENV(SERVER_PORT)
</PRE>
<HR>
</BODY>
,/HTML>
END_OF_HTML
into a file called server.cgi. Perl is on my machine. If I click on
it using Explorer then zilch. Its supposed to show up as an HTML file
with the server port displayed. Instead it simply does not appear at
all.
The first line looks like a piece of Unix - telling the machine to
execute the file using Perl in bin. I don't have Unix but XP. I do
have a directory C:/Perl/bin with a host of executables in it. Any
ideas on how to get this to go?
Mark
Hi,
Basically, you need to install and set up an HTTP server on your
machine such as Apache. There are several others out there, but Apache
is considered the best. This URL http://httpd.apache.org/docs/2.2/
should tell you everything you need to know about setting it up.
There's also a perl.beginners.cgi newsgroup that may offer more help if
you get stuck.
The #! on the first line is a shell directive known as the "shebang"
and if you go with Apache, you should make it the path to your perl
executable: #!C:/Perl/bin/perl.exe Other web servers may or may not
need it. (Microsoft IIS doesn't)
Good luck!
.
- References:
- cgi programming in Perl
- From: Mark Tarver
- Re: cgi programming in Perl
- From: JT
- cgi programming in Perl
- Prev by Date: Re: Free Perl Editor
- Next by Date: push the same image multiple times in a PerlMagick object
- Previous by thread: Re: cgi programming in Perl
- Next by thread: push the same image multiple times in a PerlMagick object
- Index(es):
Relevant Pages
|