Solved

Perl Script on NT Server

Posted on 1998-07-11
6
157 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
  • 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
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…
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…
This is a video that shows how the OnPage alerts system integrates into ConnectWise, how a trigger is set, how a page is sent via the trigger, and how the SENT, DELIVERED, READ & REPLIED receipts get entered into the internal tab of the ConnectWise …

929 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