Perl Programming for the World Wide Web

Ruben Safir

ruben@wynn.com

Copyright 1999

Recommended Books:

Programing Perl (The Camel Book):

Authors: Wall, Chrstiansen & Schwartz

Publisher: O'Reilly

CGI Programming on the World Wide Web

Authors: Shishir Gundavaram

Publisher: O'Reilly

Resources:

http://www.perl.org

http://perl.apache.org

http://www.linux.org

comp.infosystems.www.authoring.cgi

comp.lang.perl.misc

Compuserve: go unixforum

Mailing List: modperl@apache.org

Introduction:

PERL: The Practical Extraction and Reporting Language.

Perl is a blue blooded unix programing language. While it has been graphed to other operating systems,

it's lineage and pedigree is Unix through and through.

In the beginning the computer world was astonishingly empty and chaotic. Then ATT created Unix , shells, and the B - which later became the C programming language. And ATT said it was good. And most of the programming world concurred. Then ATT created text and split that text between ed the first basic text editor, and cat , the program that prints text to the screen. And the ed was called an editor. And ATT said it was good. And the Unix G-d's said it was good. Soon, ATT separated the regular expressions between sed and grep. And the Visual Editor appeared. And the regular expression engine was split between the command line below, and VI above. The Unix G-ds said it was good.

Then the Bourn Shell sprang from the shell, and was fruitful and multiplied until finally the System Administrator was created. The system administrator named all the users and protocols, each according to his insight...but confusion spread in the system administrators life, for he eat from the binary tree. And the Unix G-ds banished the system administrator to the land of AWK. But even with Bourn, Sed and Awk, the ground laid infertile.

Finally the Unix G-d's had mercy, and gave the system administrator children PERL And programers and system administrators grew fruitful and multiplied.

or something like that........

Syllabus: for Day 1

Introduction to Unix :

Logins:

The command line:

Multi User environment

Standard input, standard output, and data streams.

Files and Permissions:

chmod

chown

who

Processes:

ps -aux

kill

The Vi Editor:

calling the editor:

Command Mode

Insert Mode

Shell escape

write and quit

Open

Replace

Delete

Yank

Search

Substitution

The first perl program:

#!/usr/bin/perl

print "Hello World";

Variables:

$scalars - data types or the lack of them

@lists or @arrays

Strings and Quotes (page 41)

interpolation

escape operators (page 40)

Functions in the general form

Structured Program Design

Operators and Assignment

=

Arithmetic Operators

+, *, %, +=, -= and, **

String Operators

= ,. ,x , x=, and, .=

Unary Operator

++, --

Logic Operators

&&, ||, ! and, or, not

Comparison Operators

Two Types

Numeric: ==, !=, <, >, <=, <=>

String: eq,ne,lt,gt,le,cmp

?:

NOTE: == and = are NOT THE SAME

Precedence and Associativity: (page 76)

Left, right non-associative

Precedence

Input and Globbing:

open, close

Angle Brackets

Unary File test operators (page 85)

@ARGV (Page 55)

Conditional Expressions:

true/false

if,elsif