Solved

Perl for NT

Posted on 1998-02-17
15
277 Views
Last Modified: 2013-12-25
Where can I find a *GOOD* perl compilier for NT that I can use for my cgi scripts.  Not sure what kind of web server we have here, and I don't have access to that knowledge.  (People who knew it are gone.)  I do have full control over a cgi-bin directory, and it supposedly was made "executable" via the web server.

Not only do I need to know where to find the program, but I also need to know how to set it up.

One more pre-req for this question:  you must have at the very least set up this program to run properly, and bonus points if you are currently running it.
0
Comment
Question by:TooStupid
  • 10
  • 4
15 Comments
 
LVL 32

Accepted Solution

by:
jhance earned 150 total points
ID: 1832002
I use and recommend the port of Perl from ActiveState:

http://www.activestate.com/software/Perl_for_Win32.htm

It's about as complete as a Windows port of PERL can be.
0
 

Author Comment

by:TooStupid
ID: 1832003
OK, I got the program, downloaded it and all the FAQ's that go with it, installed it, etc.

Do you have a "Hello World" script that I can verify the install with?  How do I call this script from my HTML file?  Can I test it out locally before using my server?  (i.e. loading the file locally in Netscape and having the script execute.)  How?


0
 

Author Comment

by:TooStupid
ID: 1832004
Added 50 more points...
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 32

Expert Comment

by:jhance
ID: 1832005
1) A PERL "Hello World" script:

print "Hello World\n";

2) How to run this script from your server depends on what server it is.  Assuming it's Windows NT/IIS, this is probably the easiest:

Create a PERL script called "welcome.pl" like this:

print "Content-type: text/html\n\n";
print "<HTML>\n";
print "<CENTER>This is a test!\n";
print "</HTML>\n";

Now create an MSDOS BAT file RUNSCP.BAT to run the script in your CGI-BIN directory that looks like this:

@ECHO OFF
C:\PERL_DIRECTORY\PERL C:\PERL_SCRIPTS\WELCOME.PL

Now you can run the script from your browser like:

http://www.myserver.com/cgi-bin/RUNSCP.BAT

3) You can't run a CGI-BIN program locally from your browser without a web server.  If you need to run locally, use the MS Personal Web Server for Win95 or the PWS for NT Workstation.
0
 

Author Comment

by:TooStupid
ID: 1832006
Got the welcome.pl script.  I can run it from the DOS prompt just fine and it prints everything OK.

Created the batch file.  Put everything on the server.  Tried calling the batch file from my server.  Netscape prompted me to "Save File As".  So, next, I tried accessing the welcome.pl script.  I get prompted to save.  I put
#!Perl\bin\perl
(path to perl.exe) in the header, and still get prompted to save it.

I found out that they (MIS) are using the web server that comes with Windows NT 3.51.  There is no option for changing it (no one to support it), and nobody knows the name of the program.  (Talking to them is like talking to a brick wall, sometimes.)

So, how would I call this from a form to make it write to a window?
0
 

Author Comment

by:TooStupid
ID: 1832007
I guess that is my next option since I can't get the thing to run as is.  BTW:  I have gotten a hit counter to run, but it is a compiled executable and I call it using <IMG SRC="counter.exe?Count_Name">.
0
 

Author Comment

by:TooStupid
ID: 1832008
I compiled the welcome.pl as an executable in basic (changing code as needed, of course.)

When I call via the location, ie http://servername/cgi-bin/welcome.exe, I get prompted to save it.  However, when I call it via the location and I pass it a dummy parameter, ie
http://servername/cgi-bin/welcome.exe?dummy, I get the message
HTTP/1.0 500 Server Error (The handle is invalid. )

Does this help out any?
0
 
LVL 32

Expert Comment

by:jhance
ID: 1832009
Can you tell me what web server you are using?  There was no web server available from Microsoft for NT3.51 so it must be a 3rd party program.  If you are getting a "Save As" option when trying to run a cgi-bin program it's usually because the server doesn't have the directory that the script is in set as an "executable" directory OR the type of the executable file (i.e. .BAT) is not set as an executable file.
0
 

Author Comment

by:TooStupid
ID: 1832010
Can't tell you what web server is.  MIS doesn't know, won't take the time to figure it out.  However, I have made a little headway.  Here is what I'm doing now to call the batch file:
http://servername/cgi-bin/test.bat?

From this, I get

CGI Error

The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:

E:\httpd\htdocs>cgi-bin\Perl\bin\perl.exe cgi-bin\Perl\Scripts\welcome.pl

I get this mainly because I removed the @echo off from the batch file.
0
 

Author Comment

by:TooStupid
ID: 1832011
Note that if I get the path wrong, I get a file not found error.
0
 

Author Comment

by:TooStupid
ID: 1832012
There are a couple of options at this point in the question:

I can award you the 150 points for pointing me to the Perl program, and then ask a question on how to get it running, or
I can just add more points to your score if you can get it running.
0
 
LVL 32

Expert Comment

by:jhance
ID: 1832013
I'm afraid I'm not being much help without knowing more about the server software and it's environment.  There are any number of web servers that could be used here so we're just shooting in the dark at this part of it.  Who is MIS anyway.  Are they an ISP?  If so, what is their web site address?  Perhaps their server will identify itself.
0
 

Author Comment

by:TooStupid
ID: 1832014
MIS: Managed Information Systems.  Take care of most of the computer problems at work and also manage the network and the intranet.  BTW: They really suck.  Bunch of clueless, arrogant SOBs in my opinion (at least where I work, anyway.).

Did I mention that they suck?  Network crashed a little while ago and everyone lost a ton of work, because they couldn't figure out how to get their tape backup working properly, and didn't tell anyone.  Their latest big crash involved the mail server.  No email for two weeks!  Didn't bother to let anyone know about that  one either.

How did I get on the cgi end of all this?  I'm one of the only people in the company who can actually write HTML w/o the use of a "web editor".  Total amazement was written all over their faces when they found out.  Granted, I'm not an expert at HTML, but I manage to do what I need to do.

OK, enough venting.

I'll leave this question open for a while so other experts can take a look at it...maybe get a different opinion.  If I get an answer (posted as a comment) that works for me, I'll grade this question for jhance and then ask another question for the person who made it all happen for me.
0
 

Expert Comment

by:marar
ID: 1832015
Jhance,may be we can write a small program in C or Perl to get the header from the server. It will usually tell the name of the server, right? Once we get the name of the server, we can proceed.

I can help, if it is IIS. With the compuserv also I may be(75%)able to.
0
 

Author Comment

by:TooStupid
ID: 1832016
As promised, I'll ask another question--moving in the right direction.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ever wondered how to display how many visitors you have online. In this tutorial I will show you an easy but effective way to display the number of online visitors in WhizBase. In this article I assume you have read my previous articles and know …
Introduction This tutorial will give you a fast look what you can do with WhizBase. I expect you already know how to work with HTML at least, and that you understand the basics of the internet and how the internet works. WhizBase is a server-s…
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
The viewer will learn how to dynamically set the form action using jQuery.

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question