in reply to Re: Private Methods Meditation
in thread Private Methods Meditation
Perhaps just
or am I missing something really obvious in this example ?sub method2 { my $self = shift; _method1( $self ); }
Or for better general safety, mark the privates to make their names unique.
package Foo; sub _F_method1 { print "Foo::_method\n"; } sub method2 { my $self = shift; $self->_F_method1; } package Foo::Bar; @ISA = qw( Foo ); sub _F_B_method1 { print "Foo::Bar::_method\n"; } package main; my $foobar = Foo::Bar->new; $foobar->method2;
update: s/exclusive/unique/
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Private Methods Meditation
by hardburn (Abbot) on Jul 19, 2004 at 12:47 UTC | |
by guha (Priest) on Jul 19, 2004 at 16:12 UTC | |
by dragonchild (Archbishop) on Jul 19, 2004 at 17:16 UTC | |
by diotalevi (Canon) on Jul 20, 2004 at 01:35 UTC | |
by hardburn (Abbot) on Jul 19, 2004 at 16:36 UTC |