2.4 Testing the Configuration

After configuring Perl, test the configuration through the following steps:

2.4.1 Executing Perl Scripts from Web Browser

  1. To execute a script, the script or the subdirectory containing the script should be present in the sys:\perl\web directory.

    To execute the samples in the sys:\perl\webdemo folder, copy them to the sys:\perl\web directory.

  2. Enter the URL, in the form of ‘http://Server_name:port_number/perl/scriptname

    For example, the URL for executing the script env.pl located under sys:\perl\web\perlscripts will be

    http://server_name:port_number/perl/perlscripts/env.pl

    If the setup is correct, information about environment variables is displayed in the browser.  

2.4.2 Executing Perl Scripts from Command Line

  1. The Perl sample scripts are available in the sys:\perl\scripts folder.

  2. Execute the following command at the server console

    perl <scriptname>
    

Example:

perl hello.pl

The above command opens a perl screen and displays the output. Press any key to close the screen.

By default, Perl will try to locate the script to be executed in sys:\perl\scripts or in PERL_ROOT if set. To execute scripts in any other locations specify the full path of the file or set the PERL_ROOT accordingly.