[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 166
  • Last Modified:

Perl Script on NT Server

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
donb1
Asked:
donb1
  • 3
  • 2
1 Solution
 
alamoCommented:
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
 
donb1Author Commented:
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
 
ozoCommented:
#
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
donb1Author Commented:
ozo-
Putting just a  #  in the first line gives:
"waiting for response from server"  -- Nothing happens.

0
 
ozoCommented:
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
 
donb1Author Commented:
Ozo
Thanks, - That worked.  I had a  send mail  script that has a wrong address.  Thanks much.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now