Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact
 
For 2023 (and 2024 ...) - we are now fully retired from IT training.
We have made many, many friends over 25 years of teaching about Python, Tcl, Perl, PHP, Lua, Java, C and C++ - and MySQL, Linux and Solaris/SunOS too. Our training notes are now very much out of date, but due to upward compatability most of our examples remain operational and even relevant ad you are welcome to make us if them "as seen" and at your own risk.

Lisa and I (Graham) now live in what was our training centre in Melksham - happy to meet with former delegates here - but do check ahead before coming round. We are far from inactive - rather, enjoying the times that we are retired but still healthy enough in mind and body to be active!

I am also active in many other area and still look after a lot of web sites - you can find an index ((here))

Well House Consultants
You are on the site of Well House Consultants who provide Open Source Training Courses and business hotel accommodation. You are welcome to browse and use our resources subject to our copyright statement and to add in links from your pages to ours.
Other subject areas - resources
Java Resources
Well House Manor Resources
Perl Resources
Python Resources
PHP Resources
Object Orientation and General topics
MySQL Resources
Linux / LAMP / Tomcat Resources
Well House Consultants Resources
Extras Resources
C and C++ Resources
Ruby Resources
Tcl/Tk Resources
Web and Intranet Resources
Perl module P213
Creating your own Classes
Exercises, examples and other material relating to training module P213. This topic is presented on public course Perl for Larger Projects
In Perl, you can define a class of objects in a module. All the standard Object Oriented facilities are available, and we start with constructors, destructors, instances and accessor methods.

Related technical and longer articles
Is Perl truly an OO language?
Object Orientation in Perl - First Steps

Examples from our training material
3cl   Object Orientation - 2 classes and polymorphism
antest   Introduction to Objects
at2   Hello Perl Object World
bd1.pm   A simple class, using a scalar to store object information
bd2.pm   A simple class, using a list to store information about each object
bd3.pm   A simple class, storing each object in a hash
big   How Object Inheritance is done in Perl
blessing   Blessing and resultant polymorphism
book.pm   A simple class with a constructor and 2 access methods
ce.pm   Object interface to call events
commute.pm   commute.pm - used in factory demo
higloo   houses and igloos - an OO example
housing.pm   Definition of house, castle and igloo classes
journey   Call to factory class. See ramble.pm and commute.pm
massage.pl   Template object and test program
medium   OO with inheritance demonstrated
message.htp   Sample template for use in other demos
message.pl   None-OO example of template filling
need1   calling subs via bare words
need2   Solving the bare word
nsp   variables in packages (autovivification!)
oco   Using the house, castle and igloo classes
peeps.pm   Definition of two classes and polymorphism
ramble.pm   A class that includes a factory method
roar   Sample program to use room.pm
room.pm   A simple class which uses a blessed hash
scemail   quick check of email address format
small   True OO example
spammer   Using global matching to extract all matches
thing.pm   Generic class for use during exercises
tiny   Towards OO in Perl
ub2   A test program to use the "book" class
ub3   Another test program to use the book class
ubany.pl   Test program for ub1 ub2 and ub3 classes
usebook   Sample application, constructs and uses book objects
wheretogo   Example that uses commute.pm and ramble.pm
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
Resume -- using a class.
Background to instance variables.
Variables, addresses of variables, contents of variables.
A first class.
Structure of the class file.
The new method.
Other methods in the class.
Storing information using complex structures.
Writing applications that are independent of the class internals.
Using a scalar to store information within a class.
Using a list to store information within a class.
Using a hash to store information within a class.
Further capabilities of a hash.
The ability to provide generic set and get methods.
AUTOLOAD.
Summary.
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 700 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.


You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2024: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho

PAGE: http://www.wellho.net/resources/P213new.html • PAGE BUILT: Sat Oct 16 08:23:07 2010 • BUILD SYSTEM: wizard