Object Oriented Perl - First Steps
Archive - Originally posted on "The Horse's Mouth" - 2008-11-01 12:11:20 - Graham EllisThere 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