In short, an object is nothing more than a structure of data
that has a "name". The compiler uses that name to find
a set of subroutines, methods, that are assured of working
with that structure. So, no, the methods aren't bootstrapped
into memory once for each object, they are just subroutines
that perl knows work well with a data structure.
Honestly, all the jargon makes it a lot more mysterious
than it really is but you need the jargon to talk about
the subtleties of it all.
- Class
- a data structure blueprint and a set of subroutines
that know how to work on that structure.
- Method
- a subroutine that knows how to work on a particular
data structure.
- Object
- a chunk of real data that follows a blueprint
and has a field in it that knows what Class it belongs to.
- Instantiate
- to use the blueprint in a Class to create
a new, filled-out data structure.
- Call
- look up a subroutine by it's method name in the Class
that the object belongs to.
- Inherit
- borrow general purpose routines from a "parent"
that work on parts of your structure.
HTH. There is a lot more to it but that is a sorta
ok mapping to the world you are likely to have been working
in. Others, help me out if I've "translated" that in some
evil way that will only hurt him later, please.
--
$you = new YOU;
honk() if $you->love(perl)