INTRODUCTION TO PERL SCRIPTING

 

 

 

General:

 

This introductory level course presents the basic concepts and capabilities of the Perl program scripting language. More than 130 complete programs are used to illustrate how to use Perl to perform various data processing and system administration tasks.

 

 

 

Objectives:

 

Upon successful completion of this course, the student will be able to:

 

         Specify the features of and uses for Perl.

         Describe and use literals and variables.

         Use Perl arrays and associative memory.

         Describe and use programming control structures.

         List and use operators.

         Format and print program output.

         Perform basic file manipulation.

         Access and manipulate directory information.

         Create and use functions.

         Describe and use special regular expression characters.

         Use Perl to perform UNIX like operations.

 

 

 

Audience:

 

Technical Users, Applications Programmers, and Systems Programmers.

 

 

 

Prerequisites:

 

Basic user level knowledge of an operating system such as UNIX or Windows 95.

Either Shell Programming, Awk, or C Language courses or equivalent experience.

 

 

 

Duration:

 

Three (3) days including classroom lecture and lab sessions.

Four (4) days without Shell Programming, Awk, or C Language experience.

 


INTRODUCTION TO PERL PROGRAMMING

COURSE OUTLINE

 

 

 


I.           INTRODUCTION

 

A.   What is Perl

B.    Structure of Perl Scripts

 

 

II.         LITERALS AND VARIABLES

 

A.   Scalar Values

B.    Numeric Values

C.    String Values

D.    Arrays

E.     Lists

F.     Associative Arrays

G.    Common Array Operations

 

 

III.       CONTROL STRUCTURES & RELATED OPERATORS

 

A.   Program Control Statements

1.     if

2.     unless

3.     while

4.     until

5.     for

6.     foreach

7.     last

8.     next

9.     redo

B.    Labeled Blocks

C.    Expression Modifiers

1.     if

2.     unless

3.     while

4.     until

 

 

IV.       FORMATTING AND PRINTING

 

A.   print Statement

B.    printf Statement

 


V.         FILE PROCESSING

 

A.   Opening/Closing Files

B.    Reading/Writing to Files

C.    Testing Files

D.    Processing Command Line Arguments

 

 

VI.       DIRECTORY PROCESSING

 

A.   Opening/Closing Directories

B.    Globbing

C.    Linking

 

 

VII.     FUNCTIONS

 

A.   Creating Functions

B.    Local Variables

 

 

VIII.   REGULAR EXPRESSIONS

 

A.   Special Metacharacters

B.    Matching Operators

C.    Substitute Operators

 

 

IX.       UNIX RELATED OPERATIONS

 

A.   Time Related Operations

B.    System

C.    Backquotes

D.    Environment

E.     File Handles