Learn Modern Perl by developing an airport search engine
  • Get experience with Perl's programming constructs
  • Write your own unit tested packages which can be used across projects
  • Learn to minimize your work by using CPAN - over 100,000 modules provided by other developers

The exercises are interspersed with a project developing an airport search engine. This project will illustrate how the Perl skills you've acquired enable you to implement sophisticated functionality as a maintainable package with only a moderate amount of coding.

DEMO PROJECT

When provided with requirements at the level of subroutine functionality, a student completing this course will be able to implement Perl scripts and modules using regular expressions, references and unit tests. They will also have experience installing CPAN modules for further functionality.

This is demonstrated through the implementation of a command-line search engine.

This course only assumes the student is capable of working on the Bash command-line interface via ssh. There is also a fast track for students with experience in another programming language such as C, C++, Java, PHP, Visual Basic, Python or Ruby.

Creating Perl scripts; the difference between modules and pragma; Scalar variables; the strict and warnings pragma; numbers of different bases; numbers and strings - and casting between the two; string operators - concatenation and repetition; strings and variable interpolation; backquotes; backslash; general string delimiters.
lists, arrays and their relationship; scalar applied to lists and arrays; undefinedness; list delimiters; joining lists into strings; merging lists; push, pop, shift and unshift; lexical and numerical sort; list range operators; map and grep.
boolean values - defined, undefined, truth and falsehood; boolean operators - && and || or not!; feature "switch" and implicit variables (and a warning not to use them); foreach, for, if, unless, while, next, last, redo ... until; ternary operators; blocks, lexical variables and global variables.
creation of hashes using single value, list and fat comma assignment; deletion of a key-value pair; the difference between false, undefined and non-existent values; duplicate keys in list hash assignment; the %ENV hash
definition and invocation of subroutines; state variable declaration; variable scope; various ways of passing parameters to a subroutine; returning arrays and hashes; passing a hash into a subroutine; using and understanding wantarray
references to arrays, hashes, scalars and subroutines; passing references to subroutines and returning them as values; using sort with the developer's own comparison subroutine; various approaches to passing named parameters to a subroutine; use of the 'ref' operator
regex matching and substitution; reading from a file; split and join; greedy vs non-greedy pattern matching; the use of the \L, \U and \E string operators; Perl's grep and regular expressions; using Getopt::Long for a CLI
Perl distributions and the directory structure; the @INC array; package inheritance with 'use parent'; CSV parsing; using OO Perl packages; unit testing; using web services; using Exporter to export functions.