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)


In reply to Re: OO Baggage by extremely
in thread OO Baggage by jynx

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.