History, Domain, Design Principles

What is a Scripting Language

Perl References and Downloads

Like C

Like Ada

Different from C, Ada

Hello World - as a Script

Hello World - Not as a Script

Hello World - Interactive Execution

Hello World - Command Line Execution


Other versions of Hello World

Prefix Dereferencers

Prefix Dereferencer: Scalar

Prefix Dereferencer: Array/List

Prefix Dereferencer: Hash

Prefix Dereferencer: Same Name, Different Dereferencer

Prefix Dereferencer: Subroutine


Dynamic Typing

Automatic Conversions

Two Kinds of Strings

String Comparison: Dictionary Ordering

String Comparison for Numeric Strings

Converting Numbers and Numeric Strings

Boolean and Truth


Uninitialized Variables

Control Structures: Print loop

     # Print whether some numbers are even or odd or zero
     $i = -5; 
     $limit = 5; 

     while ($i < $limit)
        if ($i == 0) {
            print "The number is $i, which is even"
        elsif ($i % 2 == 0) {
            print "$i is even"
        else {
            print "$i is odd"


More on Loops: next and last

Unless - the Anti-if

More on Loops: Named Loops

Modifying Statements: if, unless, until, while

More control: exit and die

Read/Print Until EOF

Read/Print Until EOF with Defaults: $_ and <>

Use English

Named Files and Default File Handle

Command Line Arguments



Reading the Entire File

Lists and Arrays



Regular Expressions

Some Rules of Thumb

Some Things We Haven't Talked About (much)