[JaxPM] Re: Perl Question

Bill Jones bill at fccj.org
Fri Jul 14 12:36:05 CDT 2000


On the jacksonville-pm-list; Jax.PM'er Bill Jones <bill at fccj.org> wrote -

Well, there is a Jax.PM list which has people who are more into NT than I;
you may want to join that list and repost your query.  Also, there are
various Perl-centric lists and then there is Usenet (comp.lang.perl.misc)

To get back to your question:  I see nothing wrong with your syntax (I did
clean it up a bit) but it should work IF you have the following set-up:

1.  ActiveState perl installed correctly...

2.  Perl set as the CGI type for your web server (how to do this is in the
ActiveState docs which comes with ActiveState Perl.)

Your IIS server knows about CGIs and perl, etc...

Or, you are welcome to sign up for my CGS2283 Server class which is being
offered in the Fall here at FCCJ.

BTW:  here is your code:


#!/where/is/perl ???
# You never set an executable location...

#This causes page to be returned in a browser:
# (It doesn't, the CGI system hooks STDOUT to your browsers data channel.)
print "Content-type: text/html\n\n";

&Header;
&Body;
&Footer;

exit(0);  # Not needed, but if used should be exit; only...

sub Header {

print    <<EOH_HTML;
<html>
<head>
<meta name="author" content="Todd Proffitt">
<meta name="description" content="This is where the description goes.">
<title>Testing Perl Programming in web browser</title>
</head>
EOH_HTML

}


sub Body {

print    <<EOH_HTML;
<body TEXT="#000000" BGCOLOR="#ffffff" LINK="#0000ff" VLINK="#ff0000"
ALINK="#ff0000">

<h1><center>Testing Perl Programming in web browser</h1></center>

<P>This is the first line of text........................testing to see how
far it will go. &nbsp;
Will this text wrap or not, etc...
<P>
<P>

<b>This page returned in Browser</b>
</body>
EOH_HTML

}


sub Footer {

print <<EOH_HTML;
<CENTER><IMG alt="" border=0 height=11 src="../../../grayhr.gif" width=471>
<b><font size=-2>This page was last updated on: May 12,
2000</font></b></center>
</body>
</html>
EOH_HTML

}


__END__
This works for me...

Content-type: text/html

<html>
<head>
<meta name="author" content="Todd Proffitt">
<meta name="description" content="This is where the description goes.">
<title>Testing Perl Programming in web browser</title>
</head>
<body TEXT="#000000" BGCOLOR="#ffffff" LINK="#0000ff" VLINK="#ff0000"
ALINK="#ff0000">

<h1><center>Testing Perl Programming in web browser</h1></center>

<P>This is the first line of text........................testing to see how
far it will go. &nbsp;
Will this text wrap or not, etc...
<P>
<P>

<b>This page returned in Browser</b>
</body>
<CENTER><IMG alt="" border=0 height=11 src="../../../grayhr.gif" width=471>
<b><font size=-2>This page was last updated on: May 12,
2000</font></b></center>
</body>
</html>

Hope this helps...
- FCCJ * 501 W State St * Jacksonville, Fl 32202 * 904/632-3089 -

> From: "Proffitt, Todd " <Todd_Proffitt at csx.com>
> Date: Fri, 14 Jul 2000 12:53:21 -0400
> To: "'sneex at fccj.org'" <sneex at fccj.org>
> Subject: FW: Perl Question
> 
> Bill, oops here is the corrected browser_page.pl file.
> 
> -----Original Message-----
> From: Proffitt, Todd
> Sent: Friday, July 14, 2000 12:46 PM
> To: 'sneex at fccj.org'
> Subject: Perl Question
> 
> 
> Bill,
> I got your name off of http://www.pm.org/groups/north_america.shtml
> <http://www.pm.org/groups/north_america.shtml>
> 
> Is it possible to get your help on a basic Perl question, or is there
> anywhere you could recommend I could get help with Perl? I have a Perl book
> "Perl for Dummies" however I need a step by step way to write Perl programs
> that can be returned to a browser (only on Microsoft Windows NT for now)
> from the server. 
> 
> I am trying to get a perl file stored on a NT server to return a response to
> a user's browser. Is there anything you can tell me about doing this. I
> already have Perl installed on the server (in directory D:\Perl5\perl.exe)
> however I get an error message:
> 
> Server Application Error
> The server has encountered an error while loading an application during the
> processing of your request. Please refer to the event log for more detail
> information. Please contact the server administrator for assistance.
> 
> The event log only says an error occurred. When I try to access the file by
> using this URL to request the perl file:
> http://tecweb/tech_serv/browser_page.pl
> <http://tecweb/tech_serv/browser_page.pl>   (and the Tecweb directory is the
> D:\Tecweb share). It is an Intranet site.
> 
> Attached is my test file. Any help appreciated.
> 
> 
> 
> Todd Proffitt
> Specialist Systems Support
> 904-366-5221
> MCP+Internet, MCSE
> 


Jax.PM Moderator's Note:
This message was posted to the Jacksonville Perl Monger's Group listserv.
The group manager can be reached at -- owner-jacksonville-pm-list at pm.org
to whom send all praises, complaints, or comments...




More information about the Jacksonville-pm mailing list