EEC Logo

Perl v5 Programming

Duration: 5 days

Audience

Software engineers, programmers, web site administrators, and system administrators who will be designing and creating programs using Perl. Anyone desiring the ability to read and understand Perl programs for maintenance and update purposes.

This course is available in a "crunched" 4-day version, which eliminates some of the extended lab reviews and prolonged discussions of alternate techniques.

Course Contents

  1. Why Perl?

    1. The Hello World Program

    2. Prompting for Data

    3. Adding Choices

    4. Handling Varying Input Formats

    5. Moving the Secret Word List to a File

    6. Obtaining Info from the OS

    7. Lesson Review

  2. Scalars

    1. Numbers

    2. Strings

    3. Scalar Conversion

    4. Scalar Variables

    5. The undef Value

    6. Lesson Review

  3. Arrays

    1. Array Literals

    2. Operators

    3. Scalar and Array Context

    4. Array Input

    5. Joining Array Elements Together

    6. Variable Interpolation of Arrays

    7. Special Arrays

    8. Lesson Review

  4. Control Flow

    1. Statement Blocks

    2. if and unless

    3. while and until

    4. for and foreach

    5. last, next, and redo

    6. Labeled Blocks

    7. Expression Modifiers

    8. and and or and How to Use Them

    9. &&, ||, and ?: Conditions

    10. Lesson Review

  5. Debugging

    1. Theory of Operation

    2. Basics of Commands

    3. Breakpoints and Tracing

    4. Displaying Data

    5. Single-stepping

    6. Continuing Execution

    7. Nifty Features of the Debugger

    8. Bugs in the Debugger

    9. Common Goofs for Novices

    10. Modules and Packages (in Brief)

    11. Wrap-up

    12. Lesson Review

  6. Hashes

    1. What Are Associative Arrays?

    2. Literals

    3. Using Associative Arrays

    4. Associative Array Access - keys and values

    5. Associative Array Access - each and delete

    6. Operators and Access Functions

    7. Special Associative Arrays

    8. Advanced: Sorting Tips for Hash Arrays

    9. Lesson Review

  7. References

    1. How Do I Put an Array Inside an Array?

    2. What is a Reference?

    3. Creating Hard References

    4. Anonymous Arrays

    5. Anonymous Hashes

    6. How Do I Access What the Reference Refers To?

    7. Using the Arrow Operator

    8. Where to Go From Here

    9. Lesson Review

  8. Regular Expressions

    1. What Are Regular Expressions?

    2. Simple Uses of Regular Expressions

    3. An Example Data File

    4. The Matching Operator

    5. Substitutions

    6. Greedy Matching

    7. Builtin Variables

    8. Lesson Review

  9. File Input/Output

    1. Input from STDIN

    2. Using the Diamond Operator

    3. Opening and Closing Files and Pipes

    4. Output to STDOUT and STDERR

    5. File Tests and Filehandles

    6. The stat and lstat Functions

    7. Directory Access

    8. Chdir and Filename Globbing

    9. Lesson Review

    10. Addendum - ChkPath.pl

  10. Functions

    1. Defining a User Subroutine

    2. Invoking a Subroutine

    3. Return Values

    4. Function Parameters

    5. Using local and my

    6. Code Modularity

    7. Lesson Review

  11. Formats

    1. What are Formats?

    2. Defining Formats

    3. Format Specifiers

    4. Using the write Command

    5. Top-of-Page Formats

    6. Changing the Report Defaults

    7. Dynamic Formats

    8. Lesson Review

  12. Processes

    1. File Management

    2. Process Management

    3. Opening a Pipe

    4. exec

    5. Backquotes

    6. system

    7. fork and wait

    8. Signals

    9. Lesson Review

  13. System Access

    1. Users and Groups

    2. Win32 Information

    3. Using These Functions

    4. Using pack for Binary Data

    5. Using pack and unpack

    6. Network Data

    7. Lesson Review

  14. User Database Access

    1. DBM - DataBase Managers

    2. Opening and Closing DBM files

    3. Fixed-Length Records

    4. Variable-Length Records

    5. tie and untie

    6. Lesson Review

  15. Perl 5 Extras

    1. Standard Perl Library

    2. Available from CPAN

    3. Module Listing

    4. Object-Oriented Constructs

    5. Objects

    6. Lesson Review

Course Objectives

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

Instructional Technique

Students are invited to bring their current ideas and questions to the classroom for discussion. Lecture, group problem solving, and online laboratories will be used. Students will be encouraged to enhance their skills utilizing the techniques presented through classroom problem solving and controlled online workshops. This course is approximately 50% labwork.

Prerequisites

None, although experience in any interpreted scripting language would be particularly helpful (Visual Basic, Unix shell, TCL/Tk, Python, JavaScript, etc).