Answers to Common PerlIS Problems.


What do I change in IIS?

If you run the install batch files that are included in the archives, you will not have to manually edit the registry.

Here's the configuration changes I needed to make for Perl 5 to work on IIS 3.0 on NT 4.0 release (service pack 2 and NT Resource Kit).

Perl is located in c:\perl

1) None. If you use the included batch files, it is quite simple. Run perlw32-install.bat first, then perlis-install.bat and finally perlscript-install.bat. They are located in c:\perl\bin

2) IIS Directory Settings - Read & Execute

3) Restart the Web server service.


Where can I find The IIS FAQs?

The Address is: http://www.genusa.com/iis/

Unix scripts start with "#! user/bin/perl", what about NT scripts?

This works for me in most cases:

print "HTTP/1.0 200 OK\n";
print "Content-type: text/html\n\n";

Even better, you can check if the script is running via PerlIS.dll
or not, putting the line:

print "HTTP/1.0 200 OK\n" if $ENV{"PERLXS"}=~/PerlIS/i;

This will print the line if you're running PerlIS.dll and not if
you're running Perl.exe.

PerlIS DOESN'T automatically send the Content-type. It appears in your
document because the server did not get a status code, it assumes it
was 200 OK and the Content-type was text/html.

To disable this to use the redirect statement
Location: URL .

Use:
print "HTTP/1.0 302 Found\n";
print "Location: $URL\n\n";


What is the difference between CGI and ISAPI?

The problem is not one of incompatibility, it's one of understanding. While they can be used for similar tasks CGI and ISAPI are not the same things. CGI specifies in some detail how the application and server are to interact. In particular the HTTP status code returned by the client is based on the applications return status. The CGI app has no control over this item. ISAPI apps like perlIS are responsible for the entire stream of data just as though you are using an nph CGI. Is it broken? No! Is it incompatible? No it's just different. I think the fact that people have made perl and CGI synonymous adds to the confusion here. What has really happened is Hip has allowed us to use Perl to write server extensions as an *alternative* to CGI applications.

Philip Nelson

When is it perl that's running and when is it Perlis?

To detect that PerlIS.dll is running a script and not perl.exe the environment variable PerlXS is set to PerlIS.

So, at the top of every main script that generates HTML a good thing to do would be

if($ENV{'PerlXS'} eq 'PerlIS')
print "HTTP/1.0 200 OK\n";


Back to Top