Re: cgi programming in Perl



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!

.



Relevant Pages

  • Re: Port upgrade/install problem: MySQL and Perl I/F
    ... Subject: Port upgrade/install problem: MySQL and Perl I/F ... When I try to portupgrade the perl interface, ...
    (freebsd-questions)
  • Re: Dynamische Website mit Java (CGI ?)
    ... ich kann damit Perl und php-Skripte in einem Formular aufrufen). ... den Apache httpd gestartet. ... Muss bei Apache ein anderer Port als 80 eingestellt werden? ... (myc_CGI.exe, also ein überstztes C-Programm) ...
    (de.comp.lang.java)
  • Problems with Device-SerialPort
    ... I'm trying to posr a perl application from FreeBSD to Soalris 10 X86. ... I have several SunFire 2100's for this, which do have a serail port ... checking for gcc... ...
    (comp.lang.perl.modules)
  • To use.perl port or not?
    ... I recently installed the perl-5.8.2_5 port and ran 'use.perl port' to make ... that new perl the default system perl. ... It seemed after those upgrades 'mozilla related' apps because quite unstable: ... Today I was doing a routine upgrade of epiphany and it failed in configure ...
    (freebsd-questions)
  • Re: cgi programming in Perl
    ... I'm working from 'CGI Programming with Perl' from O'Reilly. ... Listening on Port: $ENV ... There are several others out there, but Apache ...
    (perl.beginners)