Web Languages Series:

Perl Fundamentals (CIWPERL)

Perl Fundamentals is a three-day course that teaches students how to fully utilize the Perl programming language. Students learn the Perl syntax, the basics of using regular expression, how to use Perl data types, and how to access and manipulate files. Students are also introduced to database connectivity and debugging techniques.

Target Audience

Webmasters, software developers, application programmers, client/server developers, and desktop publishers.

Job Responsibilities

Implement and maintain hypertext-based Web sites using authoring and scripting languages; apply human-factors principles to design; create Web content; and use Web management tools and digital media tools.

Prerequisites

Students must have CIW Foundations certification or equivalent experience, and be proficient in Hypertext Markup Language (HTML) authoring. No previous programming experience is required.

Topics

Introduction to Perl

  • What is Perl?
  • History of Perl
  • Why Use Perl?
  • Basic Syntax
  • The print Function
  • A Simple Script
  • Scalars
  • Numerical Data
  • Strings
  • Expression Operators and Syntax
  • Type Conversion
  • Retrieving Data From STDIN

Flow Control

  • Boolean Expressions
  • The if Statement
  • The for, while, and do while Loop Statements
  • Loop Labels
  • The next, last, redo, and goto Statements
  • The I/O Redirection Paradigm

 

Regular Expressions

  • Pattern Matching
  • A Simple Regular Expression
  • Metacharacters
  • Character Classes
  • Quantifiers
  • Assertions
  • Substitution
  • The =~ Operator
  • Using Parentheses as Backreferences
  • The split and joint Functions

Arrays

  • Using Arrays in Perl
  • Using Arrays with Loops
  • Accessing Array Elements
  • Using Lists
  • The foreach Loop
  • The sort, push, pop, shift and unshift functions
  • Using an Array as a Queue or a Stack

Hashes

  • Hash Syntax
  • The values, keys, and each Functions
  • Using Hashes as Arrays

Subroutines

  • Defining A Subroutine
  • Calling a Subroutine Directly and Indirectly
  • Passing Values to a Subroutine
  • Passing References to a Subroutine
  • Variable Scope
  • Returning a Value

File I/O

  • What is a Filehandle?
  • Using open Function to Obtain Filehandle
  • Outputting Data to a File
  • The close Function
  • Opening Files for Reading
  • Reading Data From a File

Using the stat and lstat Functions to Creating Packages in Perl

  • Instance and ClassVariables
  • Instance and Class Methods
  • Obtain information About a File

Accessing Command Line Arguments and Environment Variables

  • What are Environment Variables?
  • Accessing Environment Variables
  • Accessing Command Lines Arguments

Using Packages and Modules

  • Using Modules
  • Creating Objects
  • Calling Methods

Creating Packages in Perl

  • Instance and ClassVariables
  • Instance and Class Methods

Database Connectivity

  • Benefits of Using Databases
  • The Database Interface Module (DBI)
  • Using a Database Driver
  • Connecting to a Database
  • Querying the Database
  • Closing the Connection
  • Introduction to Structured Query Language (SQL)
  • The SQL SELECT Statement
  • The SQL INSERT Statement

Debugging Perl

  • The –w Switch
  • Issuing Commands to the Debugger
  • Tracing Script Execution
  • Designing Perl Scripts to Minimize Bugs
  • Using the strict Package