Solved

Perl Script on NT Server

Posted on 1998-07-11
6
161 Views
Last Modified: 2010-03-05
I have a perl script that works fine on unix.  How can I make it work on NT.  (Perl is installed on the server)
1. In the html form,  I used
    <form action="http://......../cgi-bin/script.cgi" method="POST">
2. In the first line of the script I put:
     #!c:\usr\bin\perl.exe
It did not work - gave the response:
"%1 is not a valid Windows NT application."
0
Comment
Question by:donb1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 6

Accepted Solution

by:
alamo earned 50 total points
ID: 1208362
On NT the "#!c:\usr\bin\perl.exe" isn't used to indicate the application like it is in Unix, but instead the registry must be properly set up to launch perl based on the script file exension.

I suspect your perl installation set the server up so .pl will work... rename the file to script.pl, change the html page to refer to it, and I bet it will work.

Hope this helps!
0
 

Author Comment

by:donb1
ID: 1208363
I changed extension to .pl and
I used  c:\perl\bin\perl.exe  in the first line -- got the following message back:
CGI Error

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

Backslash found where operator expected at C:\Inetpub\Virtual\Donb\cgi-bin\action.pl line 1, near "perl\"
syntax error at C:\Inetpub\Virtual\Donb\cgi-bin\action.pl line 1, near "perl\"

What do I need in the first line??
0
 
LVL 84

Expert Comment

by:ozo
ID: 1208364
#
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:donb1
ID: 1208365
ozo-
Putting just a  #  in the first line gives:
"waiting for response from server"  -- Nothing happens.

0
 
LVL 84

Expert Comment

by:ozo
ID: 1208366
At least we're getting different messages each time...
I meant that your
#!c:\usr\bin\perl.exe
was a comment, not perl code, so you shouldn't remove the #

But I'm now wondering what you have in the second and subsequent lines.
Can you get something simple working? like

#!c:/usr/bin/perl.exe
print "Content-type: text/html\r\n\r\n";
print "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML//EN\">\n<HTML><HEAD><TITLE>test</TITLE>\n</HEAD><BODY></BODY></HTML>";
0
 

Author Comment

by:donb1
ID: 1208367
Ozo
Thanks, - That worked.  I had a  send mail  script that has a wrong address.  Thanks much.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Six Sigma Control Plans

705 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