Add the Perl bin directory to your path
February 14, 2000
Oftentimes, it is convenient to be able to run the Perl
executable from within a DOS session without having to
explicitly specify in which directory Perl is installed.
For example, suppose you just want to be able to type
perl scriptname.plx
from the command line rather than having to type:
c:\perl\bin\perl.exe scriptname.plx.
In order to do that, you need to let your computer know where
perl.exe is located. And in order to do that, you need to
modify the PATH environment variable. In this section, Perl
is letting you know that it is going to automatically modify
the PATH variable on your behalf.
|
Note that by including the Perl "bin" directory in your path
also means that your computer will automatically know where
other related programs are as well such as perldoc.
|
However, you should note the significance of the statement
"...all other Perl directories to be removed from the PATH.".
Bear in mind that after this installation, you will have to
add to the path the location of any different installations
of Perl that you may wish to use concurrently. However, most
users will be satisfied with a single installation and will
not need to worry about this.
Associate '.pl' with Perl.exe in Explorer
This note is relatively self-explanatory. This option means
that every time you double click on a file suffixed ".pl" in
Windows explorer, your machine will use the Perl interpreter
to execute the file. The behaviour you will see is that a
"Command Prompt" window will appear, and the Perl script will
be executed within it.
The practical effect of this can be seen after you have
completed your installation of Perl.
Associate '.pl' with Perl.exe for your Web server(s)
Associating the .pl extension with the Perl interpreter in Windows
Explorer is convenient for you as a developer because you can more
easily run scripts. However, if you are a web developer, you also
need to associate the extension from the point of view of the web
severs you are using. That way, the web server will have a better
idea of what a Perl script is.
On a systems level, associating the extension with Perl.exe for
your web server means that the installer will edit your windows
registry that will instruct IIS to associate scripts with a ".pl"
extension as being suitable for execution by the Perl interpreter.
More importantly, the standard error and standard output generated
by Perl scripts will be printed directly to the browser. This is
a core feature from the point of view of writing
CGI [ Common Gateway Interface ]
scripts.
Associate '.plx' with Perl for ISAPI in IIS
The effect of this installation option is that the execution of
Perl scripts through the web server will be optimised. ISAPI
stands for Internet Server Application Programming Interface.
The way that the execution of Perl scripts by the web server
usually works is that as a preliminary step to the execution
of the script, the web server has to actually load the Perl
interpreter into memory. It does this every time the CGI is called.
The use of ISAPI means that the web server has access to the
Perl interpreter bundled as a runtime DLL that can be loaded
once by the web server. Once loaded the interpret will persist
in memory and not need to be reloaded for subsequent CGI calls.
This functionality is only available if you have installed a web
server that implements the ISAPI.
There are security/stability implications associated with running
Perl in the same thread of execution as the web server [as opposed
to starting a separate process to load the Perl interpreter and
execute the CGI ]. However, aside from mentioning them, these
matters are outside the scope of this article.
An associated point is that loading the Perl interpreter as a
persistent DLL in the web server makes it even more important
to close down IIS prior to installing a new version of ActivePerl.
Getting Started
Introduction to Perl on Windows - Table of Contents
Choosing an Installation Directory
|