view · edit · attach · print · history

Introduction To Perl

Where: Milne 130
Date: Wednesday, January 13th
Time: 5:00 - 6:50pm
Workshop files: Browse
Reference sites: Regular-Expressions.info, Quick Reference Sheet, Yahoo!

What is Perl?

Perl is an interpreted programming language (no need to compile) designed for a wide variety of applications. Today, it is commonly used to create dynamic web pages. It is also valuable in creating stand-alone executables. One of perl's perks is that is installed by default on most unix-based operating systems, making it readily available to programmers.

Impress me

  • Perl has built-in support for regex, the most powerfull string-matching syntax known to mankind.
  • Perl can be used in an object-oriented manner, with more than 7400 open source modules available via http://www.cpan.org.
  • Perl is able to interface directly with the command line and therefore interact with any program (i.e. `ls`, `convert`, other perl programs, etc).

What will this workshop cover?

Below is a basic outline of what I will prepare to cover. Of course, if we run out of time, we run out of time. If you know perl's basics, you are welcome to come 30 minutes late for the Regex section which I plan to devote a lot of time to. The section on creating modules may be cut short due to time constraints.

  1. Basics
    1. Create a "Hello World!" script
    2. Execute the above script

  2. Data Structures
    1. Scalars (numbers, strings)
    2. Arrays
    3. Hashes

  3. Control Syntax
    1. if, elsif, else
    2. Loops
      1. for
      2. foreach
      3. while
    3. One-line variants of above

  4. File IO
    1. Read
      1. As lines into Array
      2. As lines with 'while' loop
    2. Write/Append

  5. Regex
    1. Basic Form
    2. Wildcards
    3. Beginning / End of string
    4. Use for parsing
    5. Use for spliting
    6. Use for replacing

  6. Functions
    1. Syntax
    2. Passing Data To / From

  7. Calling Arguments
    1. Using built-in array
    2. Using Getopt

  8. Modules
    1. Format
    2. 'new' method
    3. variables
    4. blessing (yes, you bless objects)
    5. additional methods
    6. inheritance
view · edit · attach · print · history
Page last modified on January 13, 2005, at 11:56 AM