Perl

Perl Quotes and Escape Sequences

Perl string literals are enclosed in quotation marks. You can use either single quotes ('') or double quotes ("").

print "hello";
print 'hello'; 

Now suppose you need to print a string which contains a single or double quote such as following strings:

This is bob's watch.
Alice replied, "It was a birthday gift."

If I do the following,

Installing Perl/CGI on Microsoft Windows

My Configurations

My system is configured as follows:

Web root = c:/www Apache version = 2.2.6 Apache installation directory = c:/Apache2.2/

Download ActivePerl

Download windows MSI version from http://www.activestate.com/store/activeperl/download

Install ActivePerl

Double click on the downloaded file to install it. By default it installs at c:/Perl.

Test Installation

To test whether the installation was successfull, we need to create and run a hello world file.

Couldn't spawn child process

When using Apache and Perl on Windows, it is common to get Couldn't spawn child process error. The solution is very simple. Verify that you have using the correct directive at the top of your file.

!#/usr/bin/perl 

should be changed to

#!c:/Perl/bin/perl.exe 

I am assuming that your perl.exe file is located at c:/Perl/bin/perl.exe. If it is at another address, use that address.

Perl

Perl Variables Perl is different from popular languages like C, C++, and Java. In C, variable is name of a memory location. You can store a piece of data in it like an interger, a floating point number, a character etc. Before using a variable, you have to declare it along with it type (whether it is an integer, character, etc.). In Perl you don't have to deal with all that nonsense. All you do is just use a variable.