Just another Perl shrine | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Ok so I'm just tinkering with OO for the first time, and am bound to have got this totally wrong... BUT... the documentation I can find online on OO seems thin and confusing (where is the idiots guide??). I am struggling with the following and hope someone can enlighten me: E.g. suppose I want to inherit from Email::Simple and create my own email type. Then I can add my own methods.
(Have I even got this right?) So now I can add methods which monkey about with $self->{'JOKE'}. But my question is this: if $self refers to the hash created by Email::Simple when Email::Simple->new() was called then isn't there a danger $self->{'JOKE'} is already in use? How do I know I'm not messing up variables used in Email::Simple methods? Do I need browse the Email::Simple code to check the variable I am going to use is available, or am I protected somehow, or some other answer (possibly based on me having got the whole thing wrong from the outset!) ? Thanks in advance for your help! In reply to avoiding overwriting variables in an inherited class by whatnext156
|
|