?
Solved

Perl Script on NT Server

Posted on 1998-07-11
6
Medium Priority
?
163 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 200 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

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

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! 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…
A year or so back I was asked to have a play with MongoDB; within half an hour I had downloaded (http://www.mongodb.org/downloads),  installed and started the daemon, and had a console window open. After an hour or two of playing at the command …
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
Suggested Courses

801 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