Prerequisites:
Some experience with either a programming language (preferably C), or any of the UNIX shells.
Who Should Attend:
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.
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.
Benefits of Attendance:
Students will be able to write Perl scripts that:
- Manipulate files and directories
- Use the powerful regular expression capabilites of Perl
- Generate awk like reports
- Solve problems by using Perl's associative array capabilites
- Take Advantage of Perl's powerful interface to UNIX and other Oses
- Perform network communication including those tasks accomplished through CGI programming
- Perform many system administration functions
- Be able to use Perl to write CGI applications
- Be able to use Modules from the Standard Perl distribution
- Use Perl data structures and references
- Use object orientation in Perl
- Create objects and reuse classes
Tuition:
Tuition for the course is $1,925
Course Outline:
CHAPTER 1: A PERL TUTORIAL
- What is Perl?
- Where can I get Perl
- The first Perl program
- Simple I/O
- Perl variables
- Numbers
- Arrays
- Array functions
- Arrays and STDIN
- Control flow constructs
- Altering loop control flow
- Labeled Blocks for long breaks
- Statement modifiers
- What is true and what is false
- Associative arrays
- The special built in variable - $_
- Pattern matching and w/ regular expressions
- Writing your own functions
CHAPTER 2: I/O IN PERL
- Introduction
- The print function
- The printf function
- The sprintf function
- Filehandles
- Opening disk files
- File open errors
- Closing files
- Opening pipe files
- Command line arguments
- File operators
- The stat operator
- The _ filehandle
CHAPTER 3: PERL OPERATORS
- Introduction
- Table of Perl operators
- Assignment operators
- Special String operators
- Relation operators
- Logical operators
- Arithmetic operators
- The conditional expression
- The range operator
- Regular expression operators
- String operators
CHAPTER 4: ARRAYS + ARRAY FUNCTIONS
- Introduction
- Assigning values to an array
- Subscripting
- Array functions
- push and pop
- shift
- sort, reverse, chop
- split, join
- grep
- splice
- Associative arrays
- Associative array functions
- Associative array example
- Built in associative arrays
- Reading from a file into an associative array
CHAPTER 5: SUBROUTINES
- Subroutines
- Passing arguments to subroutines
- Returning values
- The require function
- @INC
- Packages
- Modules and use
- Typeglobs
- Predefined subroutines
CHAPTER 6: DATA STRUCTURES
- References
- Higher Dimensional Arrays
- Complex Hashes
- References and Subroutines
- Linked Lists
CHAPTER 7: ACCESSING SYSTEM RESOURCES
- Introduction
- File and directory system calls
- mkdir, chdir, and chown
- Opendir and readdir
- Link, unlink, rename
- Time stamps for disk files - stat and utime
- Process creation - fork
- exec and wait
- signals
- system
CHAPTER 8: ODDS AND ENDS
- eval
- warn
- quoting
- Sorting with custom comparison functions
- here strings
- tr
- pack and unpack
- Regular Expressions
- Command Line Options
- Debugging
- The strict.pm module
- The -w flag
- The Perl debugger
CHAPTER 9: GENERATING REPORTS WITH PERL
- Introduction
- Formats
- Multi-Line formats
- Filled Field formats
- Top of Page formatting
- The select operator
- Special Format Variables: $~, $^
- A sample report generator
CHAPTER 10: CLIENT/SERVER APPLICATION USING TCP/IP
- Introduction
- Internetworking with TCP/IP
- Client/Server applications
- Perl functions for networking applications
- A simple client/server application
- Code for the client program
- Code for the server program
- Client/Server Programming using Socket.pm
CHAPTER 11: A CGI PRIMER
- Introduction
- A typical form
- Web Servers & Web Clients
- HTML & HTML form tags
- CGI Input
- GET methods
- CGI Output
- Environment Variables
- Decoding form data
CHAPTER 12: MODULES & OBJECT ORIENTED PROGRAMMING
- Perl Modules included with the distribution
- What is CPAN?
- Packages v.s Modules
- The use directive
- Importing and exporting symbols
- Object Oriented Programming
- Defining and creating objects
- Implementing information hiding
- Destructors
- Inheritance
- Polymorphism
- Documenting Perl code