Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Perl Script Downloads instead of Executing 1

Status
Not open for further replies.

bknox

Technical User
Apr 13, 2004
30
US
I have installed Microsofts IIS and ActivePerl on my 2000 machine. I know the IIS is working, because I can access a web page I saved in the directory. However, anytime I go to run a script (by typing in the URL http:\\localhost\Scripts\scriptname.pl) IE asks me if I wish to download the requested file, instead of running the script. The perl script I want to run is a simple test script with the following contents:

use strict;
use CGI ':standard';

print "Content-type:test/html \n\n";
print "Hello the script is working";

I don't have the shabang line in because I am just testing to see if the perl handler is working properly. Can anyone point out what I am doing wrong?

Thanks,
 
I believe you still need to put a shebang as the first statement in your script.

There's always a better way. The fun is trying to find it!
 
You need to configure IIS to run Perl scripts

Have a look at Barbie's FAQ
faq219-3559

HTH
--Paul
 
Funny think happened when I added the Shabang line. The line looks like this:

#!c:\perl\bin\perl.exe -wT

When I access it via the web it said that it is to late to use the T switch. This message was displayed in the web browser, when I opened the .pl file and removed the T from the shabang line, then refreshed the IE page it showed up fine. However, when I re-typed the link in it asked to download the page again. Any suggestions.

Thanks,
 
Remove winblows from your server, install linux ( I like mandrake ). Enable apache and perl during the install. Enjoy the more straightfoward life of an open source developer.

--jim
 
I tried the FAQ from Barbie, but there was already a entry out there for .pl files, and it looked exactly like the one in her response. I removed it and readded it, then restarted IIS, but I am still haveing the same problem.
 
Change
Content-type:test/html
to
print "Content-type:text/html\n\n";
Could be your other problem then

When you get settled have a look at CGI.pm

--Paul
 
Your a freakin genious paul......I looked at that script and never caught that I had misspelled text. THANK YOU.

Ben
 
ur welcome, but genuis status for a pedantic slight ...

Cheers
--Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top