Object Orientation in an hour and other Perl Lectures
Archive - Originally posted on "The Horse's Mouth" - 2010-11-18 06:49:36 - Graham Ellis
I enjoy the occasional course that's different in its design and specification, and yesterday was one of those - more lectures that training, on intermediate and advanced Perl, for a group of eight delegates who were all well experienced at PHP, but Perl "dabblers" to this point. During the day, we took a number of topics, looked at each, I wrote some examples to explain the principles and my delegates then wrote some code too. Here - for them - is links to the code:
Variables
henry - shows the variable types in Perl - examples with $ @ % & and * - not to forget file handles that don't have an ordical character at the front.
References and Scope
refs - Base use of \ and $ in front of variables to create and use references ref2 - the power of references in association with "my" and scoping controls show_acc - a practical example that converts a file into a referenced structure for powerful extraction and reporting
Strings and Regular Expressions
cstr - writing stings with quotes, with your choice of single character delimiter, and your choice of multicharacter delimiter reg - building up from a straightforward regular expression and making use of many facilities provided emre - answer / discussion after exercise - keeping it simple at each step, and sparse v greedy
Object Orientation and how it works in Perl
tiny - a framework for the principles small - first true Object Oriented example in Perl, with blessed references medium - adding in inheritance where classes are based on each other rather than written from scratch big - an example that uses the autoloader to provide the ability to handle lots of attributes (properties) without having to write lots of repeating code
Coercion and other miscellanies
codemo - how perl silently converts between data types fd - where does a variable name end? shh - reading from a file named on the command line shhh - using topicalisation and "awk mode" too - run program on each line from a file.
Our public Perl courses are listed [here] .. and I can run any of those, and course to special agendas too, at our training centre or at your office. And I'm very happy to do lectures too - provided that you realise that you're not going to get as much from a day's lectures as you will from a week's course. But - yes - yesterday was judged a great success. Everyone went away with very specific issues clarified. Everyone got a "new dawn" look at some key features. And everyone enjoyed it too!