HOW TO: FP2000: How to Use Perl with Microsoft Personal Web Server on Windows 95/98 (231998)



The information in this article applies to:

  • Microsoft FrontPage 2000

This article was previously published under Q231998
IMPORTANT: This article contains information about modifying the registry. Before you modify the registry, make sure to back it up and make sure that you understand how to restore the registry if a problem occurs. For information about how to back up, restore, and edit the registry, click the following article number to view the article in the Microsoft Knowledge Base:

256986 Description of the Microsoft Windows Registry

IN THIS TASK

SUMMARY

The following article describes how to set up the Microsoft Personal Web Server to use the Windows version of Perl. This allows you to run Perl scripts on the Microsoft Personal Web Server.

This article also includes a sample Perl script that can be used to test the Perl engine on your computer.

WARNING: If you use Registry Editor incorrectly, you may cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that you can solve problems that result from using Registry Editor incorrectly. Use Registry Editor at your own risk.


back to the top

Configure the Microsoft Personal Web Server to Use Perl

For security reasons, you do not want Perl.exe to exist in any directory that can be browsed from other computers.

With a script mapping in the registry, you can place the Perl.exe outside of the normal directory structure and avoid such security risks.
  1. On the Start menu, click Run.
  2. In the Open box, type Regedit and click OK.
  3. Open the following registry key:

        HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W3SVC \Parameters\ScriptMap
  4. On the Edit menu, point to New, and click String Value.
  5. Name the value .pl and press ENTER.
  6. Select .pl, and click Modify on the Edit menu.
  7. In the Value Data box, type <the full path to perl.exe>\perl.exe %s %s

    NOTE: The "%s %s" is case sensitive (for example, "%S %S" will not work).
  8. Close the Registry Editor, and restart your computer.
NOTE: Some versions of PERL automatically add this registry key when you install.

back to the top

Create a Perl Script to Use for Testing

Create a file with Notepad, and type the following lines of code. Save the file as testing.pl in a folder in your web. Make sure this folder is marked executable.

In Notepad, type the following:
   print "HTTP/1.0 200 OK\n";
   print "Content-Type: text/html\n\n";

   print "<HTML>\n";
   print "<HEAD>\n";
   print "<TITLE>Perl Test Page</TITLE>\n";
   print "</HEAD>\n";
   print "<BODY>\n";
   print "<H3>This is a test to see if Perl is Working</H3>\n";
   print "<P>\n";
   print "<H5>If you can see this, Perl is properly configured</H5>\n";
   print "</BODY>\n";
   print "</HTML>\n";
				

back to the top

Test the Script

To test the script, browse to the Perl script in Internet Explorer.

For example, if you placed the testing.pl file in a folder named cgi-bin in your root web, you would type the following in the Internet Explorer address bar:

    http://localhost/cgi-bin/testing.pl


The third-party products that are discussed in this article are manufactured by companies that are independent of Microsoft. Microsoft makes no warranty, implied or otherwise, regarding the performance or reliability of these products.

back to the top




Modification Type:MajorLast Reviewed:10/27/2002
Keywords:kbhowto kbHOWTOmaster KB231998 kbAudDeveloper