XP is just a number | |
PerlMonks |
avoiding overwriting variables in an inherited classby whatnext156 (Initiate) |
on Apr 21, 2012 at 10:27 UTC ( [id://966337]=perlquestion: print w/replies, xml ) | Need Help?? |
whatnext156 has asked for the wisdom of the Perl Monks concerning the following question: 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!
Back to
Seekers of Perl Wisdom
|
|