Perl Introduction/Intermediate
Perl is a mature, extremely flexible, general-purpose language, which is especially well suited to textual manipulation. In addition to its brilliant built-in facilities, there are vast freely-accessible libraries of Perl code to help build almost every conceivable application. It is for –instance - in many cases the language of choice for implementing web server-based CGI programs. Perl is available free-of-charge.
This three-day course covers the basic techniques and programming structures provided by Perl5, suitable for applications of all types. It also covers the basics of web based CGI pro-gramming. It is a ‘hands-on’ course with many brief, practical examples of everyday use of Perl.
- Cost: Price on application
- Duration: 3 Days
- This course is not available as part of our public schedule but can be provided on a customised client specific basis.
Students should be familiar with the use of a text editor. Familiarity with the basic concepts of programming would be a distinct advantage
Perl as a practical language
Perl applications and capabilities
Perl flavours
Program structure
Standard input, output and error
Input and output functions and constructs
Scalars and simple variables
Integers, floats, strings
More on scalar variables/assignment
Special variables
Variable scoping
Creating expressions using operators
Conversion functions
Simple string functions
Relational expressions
if and related tests
Looping
Expressions modifiers and other control struc-tures
Defining normal arrays
Assigning and extracting values
foreach
Array dimensions, extending and reducing ar-rays...pop, shift, push, unshift
Other array functions: sort, reverse, split, join
Creating your own functions and subroutines
Passing arguments; my() and local() function
defined function
return value
Defining associative arrays
Assigning and extracting values, `unwinding` associative arrays
Associative array functions...keys, values, each, exists, delete
Filehandles and opening files for input, output and appending...open
Reading/writing data...use of special variable $_
Closing files...close
die, warn, exit and the special variable $!
File tests, eg -e FILENAME
Using @argv for multi-file processing
In-place editing
Defining a format...declaring and defining
Fieldline and fieldholder definition
Invoking a format...the write() function
Changing the filehandle using select()
Top-of-page format
Emulating operating systems commands
Globbing
Directory handles
gmtime(), localtime(), time()
Time-related modules
times()
Match operators and range operators
String pattern matching facilities
Creating references; dereferencing
Multidimensional arrays via references
Anonymous data structures
Package, use and require keywords
Standard library modules and examples
Preparing a Perl program for web server use
Unbundling data from the client
Sending dynamic HTML documents
Standard modules
Simple CGI