in reply to Re: Instance field access from private methods
in thread Instance field access from private methods
package C1; sub new { my $class = shift; my $self = {}; return bless $self, $class; } sub printGoodBye{ print "Goodbye @_ "; printWorld(); } sub printWorld{ print "World\n @_"; } 1; END {}
package C2; use base ("C1"); sub new { my $class = shift; my $self = {}; return bless $self, $class; } sub printHi{ print "Hi\n"; } 1; END {}
#!/usr/bin/perl use C2; $bob = C2->new(); $bob->printGoodBye(); exit 0;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Instance field access from private methods
by guha (Priest) on Oct 23, 2002 at 19:42 UTC | |
by markcsmith (Novice) on Oct 23, 2002 at 20:08 UTC | |
by perrin (Chancellor) on Oct 23, 2002 at 21:31 UTC | |
by guha (Priest) on Oct 23, 2002 at 21:39 UTC |