Perl Short Course: December 2011
dcw@doc.ic.ac.ukThis web page contains all the materials for my Perl Short Course, that I've just given this week (12th-16th December 2011) to Dept of Computing second year students.
Changes this year:
- Lovely Ann Arbor colourful Latex Beamer format, wow! the Perl course enters the 21st century; only 11 years late:-)
- 'my' variables from day one. (I also thought about using 'use strict' from day one: decided not to!)
- used 'IO::File()' instead of 'open()'.
- Creating modules part of lecture 6 replaced completely with new `maxfreq' example.
Here are the course materials, covering the lectures as I gave them:
First Session
- Here are the Postscript full size slides for the first session.
- Here are the PDF full size slides for the first session.
- Here are the Postscript 4-up lecture notes for the first session.
- Here are the PDF 4-up lecture notes for the first session.
- And here are the examples for the first session, as a gzipped tar file that will create a directory called lect1-examples.
Second Session
- Here are the Postscript full size slides for the second session.
- Here are the PDF full size slides for the second session.
- Here are the Postscript 4-up lecture notes for the second session.
- Here are the PDF 4-up lecture notes for the second session.
- And here are the examples for the second session, as a gzipped tar file that will create a directory called lect2-examples.
Third Session
- Here are the Postscript full size slides for the third session.
- Here are the PDF full size slides for the third session.
- Here are the Postscript 4-up lecture notes for the third session.
- Here are the PDF 4-up lecture notes for the third session.
- And here are the examples for the third session, as a gzipped tar file that will create a directory called lect3-examples.
Fourth Session
- Here are the Postscript full size slides for the fourth session.
- Here are the PDF full size slides for the fourth session.
- Here are the Postscript 4-up lecture notes for the fourth session.
- Here are the PDF 4-up lecture notes for the fourth session.
- And here are the examples for the fourth session, as a gzipped tar file that will create a directory called lect4-examples.
Fifth Session
- Here are the full size lecture notes for the fifth session.
- Here are the PDF full size slides for the fifth session.
- Here are the 4-up lecture notes for the fifth session.
- Here are the PDF 4-up lecture notes for the fifth session.
- And here are the examples for the fifth session, as a gzipped tar file that will create a directory called lect5-examples.
Example CGI Scripts from the Fifth Session
- Here is eg1.cgi: a first trivial example.
- Here is eg2.cgi: first example using CGI.
- Here is eg3.cgi: a silly form.
Sixth Session
Please note that lecture 6 as printed did not contain
maxfreq::forget()
in eg1, immediately above the call tomaxfreq::remember()
; the notes below do!Also, I realise there's an unanswered question in the slides - at the bottom of page 15/28, in the discussion of why printperson($person) isn't a method, it asks "how hard is converting a normal subroutine to a method?".
The answer is: incredibly easy in this case:
printperson
takes a person as it's first (only) argument. This is exactly like the object method calling convention, so it's very nearly a method already! Moveprintperson
from eg1 to Person.pm and rename it$person
argument as$self
. Back in eg1, change allprintperson($person)
calls to$person->print
.In the examples tarball below, code after the above modifications will be found in the
person-v2/
directory.
- Here are the full size lecture notes for the sixth session.
- Here are the PDF full size slides for the sixth session.
- Here are the 4-up lecture notes for the sixth session.
- Here are the PDF 4-up lecture notes for the sixth session.
- And here are the examples for the sixth session, as a gzipped tar file that will create a directory called lect6-examples.
dcw@doc.ic.ac.uk
Updated: December 2011![]()
![]()