There are some occasions when a new example that I write / a topic that comes up on a course results in an article that's so long that it doesn't fit into the Blog / short article format, but requires a more substantial mechanism.
And so it is for my
First steps in Object Oriented Perl examples, written yesterday and taking you through how you can hold all the data about multiple things ("objects") of a type ("class") in a hash, and then access the data easily in it through Perl subs ("methods"). The example then went on to show you how you can define slightly different types of things and keep them all in the same list, with the program working out at run time which particular piece of code to run ("polymorphism") with the detailed logic or how to deal with the data hidden with ("encapsulated") the file that describes the class ("package / module").
So I'm just giving you a taster here (see the previous paragraph) and I have provided a longer article on
Perl - First Object Steps in our separate
Solutions Centre
Other popular Perl related articles in the solution centre include:
What makes a good variable name?
Getting the current currency exchange rates in your Perl program
If several people are using the same file at the same time ...
Having your .html pages run a Perl program
An overview of what we're expecting in Perl 6 (written 2008-11-01, updated 2008-11-02)
Associated topics are indexed under
P213 - Perl - Creating your own Classes [3098] Learning Object Orientation in Perl through bananas and perhaps Moose - (2010-12-21)
[3059] Object Orientation in an hour and other Perl Lectures - (2010-11-18)
[2969] What does blessing a variable in Perl mean? - (2010-09-24)
[2877] Further more advanced Perl examples - (2010-07-19)
[2834] Teaching examples in Perl - third and final part - (2010-06-27)
[2169] When should I use OO techniques? - (2009-05-11)
[1925] Introduction to Object Oriented Programming - (2008-12-06)
[1664] Example of OO in Perl - (2008-06-03)
[1435] Object Oriented Programming in Perl - Course - (2007-11-18)
[1320] Perl for Larger Projects - Object Oriented Perl - (2007-08-25)
[983] Blessing in Perl / Member variable in Ruby - (2006-12-14)
[975] Answering ALL the delegate's Perl questions - (2006-12-09)
[246] When to bless a Perl variable - (2005-03-15)
[227] Bellringing and Programming and Objects and Perl - (2005-02-25)
Q906 - Object Orientation and General technical topics - Object Orientation: Individual Objects [3436] Moving from scripting to Object Orientation in Python - (2011-09-13)
[2651] Calculation within objects - early, last minute, or cached? - (2010-02-26)
[2393] A first demonstration of OO, including polymorphism - (2009-09-04)
[2173] Basic OO principles - (2009-05-11)
[2171] Cleaning up redundant objects - (2009-05-11)
[1543] Learning Object Oriented Principles (and perhaps Java) - (2008-02-17)
[507] Introduction to Object Oriented Programming - (2005-11-27)
Some other Articles
Liverpool - a friendly cityDomain Renewal GroupWhat a difference a day madeDebugging and Data::Dumper in PerlObject Oriented Perl - First StepsAbout dieing and exiting in PerlRemember your unitsReactive (dynamic) formatting in PerlSeven new intermediate Perl examplesWiltshire at dawn - the tourist trail