Let me know if I'm wrong, but this sure looks like it's inheriting something w/o $self being passed to me.
But it *is* passed, actually $bob is passed as the first element of @_ which is seen in the output
Goodbye C2=HASH(0x177f054) World
So you would normally shift off the first element to a lexical variable often called $self to use the subroutine as a method in OO-style
sub printGoodBye { my $self = shift; print "Goodbye "; $self->printWorld(); } sub printWorld{ my $self = shift; print "World\n "; }
So inheritance is really in play here.
I am also a newbie when it comes to perl-OO, so I watch this thread with keen interest.(++)
In reply to Re: Re: Re: Instance field access from private methods
by guha
in thread Instance field access from private methods
by markcsmith
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |