logo_michael-thomas.jpg (3143 bytes)

Perl Script - Misc Examples

This web page executes Perl scripts that return return information back to you.  I open up a separate browser window to display the results. 

Perl Setup Instructions:

  • Download and install Perl on the server to get these examples running.  If your running Windows I would install Active Perl.  

  • Next create a directory under the root of your web server called:  cgi-bin\perl   

    • MS IIS Ex: C:\Inetpub\wwwroot\cgi-bin\perl

  • Now copy all of the .pl files you extracted from the .zip file into this directory.  I have placed the .pl files in the same directory as the html files just for training/downloading.

  • Next, configure your web server to allow "Executibles".

    • Win 2000 Professional MS IIS

      • Start, Programs, Administrative Tools

      • Click on the Machine name.

      • Select the web site ("Default Web Site" is common).

      • Select the "cgi-bin" directory.

      • Right Click, then Properties.

      • Change "Execute Permissions" to: Scripts and Executables.

  • Your ready to test the examples below.


Working Examples
(Unix & WinNT, and others)

Download Perl Source - Download a zip file with this HTML file and all of the Perl source code used on this web page.

  • Web Server Info- Returns an HTML page showing information about the web server.  If your just starting to use Perl, try to get this to run successfully.
  • Hello World - Returns an HTML page saying "Hello World". 
    • Source Code:
      print "Content-Type: text/html\n\n";
      print "Hello, world! (not using CGI.pm module)\n";
  • Hello World w/CGI.pm - Returns an HTML page saying "Hello World".  Used CGI.pm module.
    • Source Code:
      use CGI;
      $cgiTest = CGI::new();
      print $cgiTest->header();
      print $cgiTest->p("Hello World. (using CGI.pm module)");