Solved

Perl Script on NT Server

Posted on 1998-07-11
6
156 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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
I have been pestered over the years to produce and distribute regular data extracts, and often the request have explicitly requested the data be emailed as an Excel attachement; specifically Excel, as it appears: CSV files confuse (no Red or Green h…
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 video discusses moving either the default database or any database to a new volume.

762 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

18 Experts available now in Live!

Get 1:1 Help Now