![]() |
![]() |
![]() |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
![]() |
![]() |
To access the contents, click the chapter and section titles.
Perl CGl Programming: No experience required.
Working with the NT Registry Editor A caveat before we go any further: The Windows NT Registry stores information that NT programs need in order to run. Be very careful to precisely follow instructions when you change entries in the Registry, because if you make a mistake, you could bring your NT system to its knees. IIS runs as an NT service, which is a program that generally starts automatically at boot-time and runs in the background. You will find IIS in the Registry folder that contains all of the currently defined NT services (see Figure 2.2): HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services
Follow these steps to find the correct CGI directory:
You have now told the Web server that it should run the Perl interpreter to execute programs with the extension .pl. Youre familiar enough with the Registry Editor by now to whip through the second step. Besides, you probably wont have to add anything. Follow this step:
Notice the /Scripts entry. The only thing that concerns us here is the directory path, which in the example is c:\Inet\Pub\scripts. This is the directory in which you will install and run your Perl CGI programs. You may change it if you like, but there is little reason to do so.
Setting Up UNIX-Style On UNIX, configuring an HTTP server for CGI and Perl is pretty simple. The standard NCSA server gets its configuration information from a text file called srm.conf. Two lines in the file answer our concerns. ScriptAlias /cgi-bin/ /usr/local/httpd/cgi-bin AddType application/x-httpd-cgi .pl The CERN server wants its configuration information in a file called httpd.conf, where the script directory is defined in this fashion: Exec /cgi-bin/ /usr/local/httpd/cgi-bin Now you should be ready to begin your first CGI program, no matter what operating system youre running. Perl Meets the World Wide WebYou learned in Skill 1 that a Perl print statement writes the text and variables following it to the screen, known among systems folks as the standard output, or stdout. This is a key concept, because in CGI, the Web server in a sense becomes the standard output, or the screen. What really happens is actually more complicated than that, but the main thing for you to understand is that when you print anything from a Perl program through CGI, it will be shipped to the server, which then has to figure out what to do with it.
|
![]() |
Products | Contact Us | About Us | Privacy | Ad Info | Home
Use of this site is subject to certain Terms & Conditions, Copyright © 1996-2000 EarthWeb Inc. All rights reserved. Reproduction whole or in part in any form or medium without express written permission of EarthWeb is prohibited. |