- Course Length:
- 5 Days
- Course Description:
- Perl is a scripting language which allows for rapid prototyping of projects formerly done with a programming language or a shell. It incorporates all the functionality of C (including a UNIX system interface), the Shells, grep, sed, and awk. The topics in the course will aid all computer users - from end user to programmer to administrator alike. Many in-class labs support the course material.
- Who Should Attend:
- This course is for programmers, end users, system administrators, network administrators, CGI script writers, or anybody who is interested in automating tasks but doesn't want to learn all the details of a full blown programming language.
- Benefits of Attendance:
-
Upon completion of this course, students will be able to:
- Manipulate files and directories
- Use arrays and array functions to solve a wide variety of problems
- Use the powerful regular expression capabilities of Perl
- Generate reports
- Use hashes to solve commonly encountered problems
- Take advantage of Perl's powerful system interface
- Write programs that solve many system administrator problems
- Use Perl to write CGI applications
- Use Modules from the standard Perl distribution
- Use Perl references
- Prerequisites:
- Students should have some experience with either a programming language (preferably C), or any of the UNIX shells.
- Course Outline:
-
- Chapter 1: Getting Started with Perl
- What is Perl?
- Where Can I Get Perl?
- A Simple Perl Program
- Simple I/O
- Perl Variables
- Control Flow - Decisions
- Control Flow - Loops
- Altering Loop Control Flow
- Statement Modifiers
- What Is True And What Is False?
- The Special Variable $_
- Chapter 2: Perl Operators
- Introduction
- Table Of Perl Operators
- Arithmetic Operators
- String Operators
- Relational Operators
- Logical Operators
- Bitwise Operators
- Assignment Operators
- The Conditional Operator
- Range Operator
- String Functions
- The eval Function
- Chapter 3: I/O
- Introduction
- String Literals
- The print Function
- Here Documents
- The printf Function
- The sprintf Function
- Filehandles
- Opening Disk Files
- File Open Errors
- The die and warn Functions
- File Operators
- Chapter 4: Arrays
- Basic Concepts
- Assigning Values To An Array
- Accessing Array Elements
- Array Functions
- push and pop
- shift
- sort, reverse, and chop
- split and join
- grep
- splice
- Command Line Arguments
- Chapter 5: Associative Arrays
- Basic Concepts
- Associative Array Functions
- Updating Associative Arrays
- Accessing Environment Variables
- Chapter 6: Subroutines
- Calling Subroutines
- Passing Arguments to Subroutines
- Returning Values from Subroutines
- The require Function
- Packages and Modules
- The @INC Array
- Predefined Subroutines
- Comparison Subroutines for Sorting
- Chapter 7: Pattern Matching and Regular Expressions
- Introduction
- Regular Expression Syntax
- The Match Operator
- Regular Expression Meta-Characters
- Anchors
- Single Character Matches
- Some Special Issues
- Character Classes
- Multiple Character Matches
- Alternation
- The Substitution Operator
- The Translation Operator
- Chapter 8: Accessing System Resources
- Introduction
- File and Directory System Calls
- The stat Function
- The utime Function
- The fork Function
- The exec and wait Functions
- Handling Signals
- The system Function
- Command Substitution
- Opening Pipe Files
- Chapter 9: Generating Reports with Perl
- Formats
- Formatting Examples
- Multi-Line Values
- Multi-Line Text Blocks
- Sending a Report to a File
- The select Function
- The Special Variable $~
- Top-of-Page Formats
- Bottom-of-Page Formats
- A Sample Report
- Chapter 10: Perl and CGI
- What is CGI?
- Web Servers and Browsers
- HTML
- HTML Forms
- Form Elements
- A Typical CGI Application
- CGI Input
- CGI Output
- Using the CGI.pm Module
- CGI Environment Variables
- Appendix A: Command Line Options and Debugging
- Running Perl on the Command Line
- Summary of Command Line Options
- The Perl Debugger
- Perl Debugger Commands
- Other Debugging Aids
- The strict Module
- Appendix B: More About Regular Expressions
- Remembered Matches
- Greedy Regular Expressions
- Nested Remembered Patterns
- Matching for Multiple Occurrences in a Loop
- Appendix C: References and Data Structures
- References
- Syntactic Sugar
- Anonymous Arrays
- Higher Dimensional Arrays
- References and Subroutines
- Appendix D: Comparing Perl 4 and 5
- Operators
- Packages
- Typeglobs
- Appendix E: Advanced Perl
- What is in the Advanced Perl Course
- A Taste of Object Orientation
- A Taste of Network Programming
- Appendix F: Perl Development Using Eclipse
- Features of the Perl Plugin
- Creating a Perl Project
- Running a Perl Program
- Preferences - EPIC
- Preferences - Editor
- Preferences - Content Assist
- Preferences - Folding
- Preferences - Mark Occurrences
- Preferences - Templates
- Templates
- Preferences - Source Formatter
- Preferences - Task Tags
- Accessing Perl Documentation
- Project Properties
- Debugging
- Testing Regular Expressions
- Appendix G: Reference
- Special Perl Variables
- Regular Expression Meta-Characters
- Internet Resources
- Chapter 1: Getting Started with Perl













