Introduction to Perl
Course Description
This course is an introduction to programming in Perl. It starts from the absolute basics and introduces enough information for attendees to be writing useful programs by the end of the course.
The course can be run over one day in lecture style or over two days including practical exercises.
Intended Audience
This course will be useful to anyone who want to starts writing programs in Perl. Attendees need no previous knowledge of Perl although it will be useful if they understand a little about programming. Whether you are a sysadmin who wants to use Perl as a glue language, a programmer who wants to use it for data munging or someone who wants to write web applications, this course will give you the basic knowledge you need.
Key Skills
After attending this course you will be able to:
- Write simple but useful Perl programs
- Use Perl’s built-in operators and functions
- Use loops and subroutines to simplify your programs
- Understand simple regular expressions
- Find and install third-party libraries
Course Outline
- What is Perl
- Perl’s name
- Typical uses of Perl
- What is Perl like?
- The Perl Philosophy
- Creating and running a Perl program
- Hello World
- Running a Perl program
- Comments
- Command line options
- Variables
- What is a variable?
- Variable names
- Types of Perl variable – scalars arrays and hashes
- Declaring variables
- Scalars, arrays and hashes in detail
- Perl’s special variables
- Input and Output
- The print function
- The file input operator
- Operators and Functions
- What are operators and functions?
- Various types of operators
- Some useful functions
- Conditional Constructs
- Introduction to Boolean expressions
- if, elsif and else
- while, until, for and foreach
- Subroutines
- What are subroutines?
- Defining subroutines
- Calling subroutines
- Subroutine arguments
- Subroutine return values
- Regular Expressions
- What are regular expressions?
- The match, substitution and binding operators
- Metacharacters and quantifiers
- Smart Matching
- The smart match operator
- What is smart matching?
- Finding and Using Modules
- What is a module?
- What is CPAN?
- Installing modules
- Using modules
- Some useful modules
- Further information
- Books
- Web sites
- Mailing lists
- The Perl community
Course Instructor
This course will be run by Dave Cross.