How do we define Inheritance and overloading in Perl? What inherits from where? What happens if a method is missing? How do we make variables from a module available in a calling module?
This topic is presented on public course
Perl for Larger Projects
Examples from our training material
| angler | Program to demonstrate use of phisherman class |
| animal.pm | A framework for a generic base class |
| basket | Sample program - polymorphism in Perl OO |
| cafe | Test application to show use of exporter |
| coin.pm | Simple base class defining a coin |
| collect | Application that uses commememorative coin class |
| commemorative.pm | A class which uses simple inheritance |
| dish.pm | Illustation of Exporter and @EXPORT |
| fldo | Set up obects via a utility factory (main prog) |
| fruit.pm | |
| horse.pm | BEGIN END DESTROY and import special methods |
| li2 | the @INC list and the %INC hash |
| lookinc | Display the @INC list |
| offspring.pm | class offspring - an animal that need attention |
| pet.pm | a pet is an animal ... inheritance ... |
| phisherman.pm | A simple class in Perl |
| ptest | test harness for the program.pm class |
| rider | Application that uses horse.pm |
| test_class_1 | Test harness for class "animal" |
| test_class_2 | Test harness for the various subclasses of animal |
| tharness | Perl program, calls 2 classes, polymorphism and interitance |
| tptest | Test program for the trainingprogram.pm class |
| transport.pm | Definition of a transport animal |
| visit.pm | Set up obects via a utility factory (classes prog) |
Pictures
Object Oriented programming for larger projects
Background information
Some modules are
available for download as a sample of our material or under an
Open Training Notes License for free download from
http://www.training-notes.co.uk.
Topics covered in this module
Where to look for modules.
Inheritance and hierarchy; base and derived classes.
Special methods BEGIN, END, DESTROY and import.
Export and Exporters.
Complete learning
If you are looking for a complete course and not just a information on a single subject, visit our
Listing and schedule page.
Well House Consultants specialise in training courses in
Python,
Perl,
PHP, and
MySQL. We run
Private Courses throughout the UK (and beyond for longer courses), and
Public Courses at our training centre in Melksham, Wiltshire, England.
It's surprisingly cost effective to come on our public courses -
even if
you live in a different
country or continent to us.
We have a technical library of over 600 books on the subjects on which we teach.
These books are available for reference at our training centre. Also
available is the Opentalk
Forum for discussion of technical questions.