Software Sue

Link to Simply Sue
Link to Sustainability Sue
location: software/scripting/perl Skip navigation : Home  

Perl


Perl stands for Practical Extraction and Report Language, which was created by Larry Wall. It is an interpreted programming language used for CGI. CGI stands for Common Gateway Interface. CGI can be used to create programs to update your web page. It also lets users send you e-mail and lets you check errors.

Perl is a jack-of-all-trades language. It is used for scripting (it can replace Unix Shell scripts), pattern-matching , list processing, and for systems functions. It is similar to C.

The Perl home page is at http://www.perl.com/perl. You can download Perl for free from http://www.perl.com/CPAN, where CPAN stands for Comprehensive Perl archive network. Perl will run through MS-DOS.

The basic Perl syntax is:

   Perl [options] [source_file | cmd]

The options include:

OptionDescriptionExample
-cCheck the syntax without running the program $ perl -c firstprog
-eSingle Perl command from command prompt. $ perl -e 'print("Hi!\n")'
-vPrint the version number (no program needed). $ perl -v
-wPrint warnings. $ perl -w firstprog

Statements should be terminated with a semicolon. Statements can span multiple lines.

Variables and keywords are case-sensitive.

Curley braces, {}, are used around statement blocks.

Function parameter blocks may optionally be enclosed in parentheses ().

There are hundreds of Perl commands. They include:

Creating a Perl program

Perl Operators

Example - tracking where your hits come from

Perl Control Constructs (loops, branches)

Perl Functions