Solved

Perl for NT

Posted on 1998-02-17
15
260 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
Comment Utility
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
Comment Utility
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
Comment Utility
Added 50 more points...
0
 
LVL 32

Expert Comment

by:jhance
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 32

Expert Comment

by:jhance
Comment Utility
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
Comment Utility
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
Comment Utility
Note that if I get the path wrong, I get a file not found error.
0
 

Author Comment

by:TooStupid
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
As promised, I'll ask another question--moving in the right direction.
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

It is a general practice to get rid of old user profiles on a computer  in a LAN environment. As I have been working with a company in a LAN environment where users move from one place to some other place at times. This will make many user profil…
Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly …
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to dynamically set the form action using jQuery.

744 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now