sub foo {
my ($self, $data) = @_;
$self->{bar} = _some_function($data);
}
####
sub _some_function {
my ( $self, $data ) = @_;
return ParentClass::_some_function($data);
}
##
##
#!/usr/bin/perl -w
use strict;
use Data::Dumper;
package Foo;
sub new {
my $class = shift;
bless {}, $class;
}
sub foobared {
my $self = shift;
$self->{foo} = _test( 3 );
}
sub _test { shift }
package Bar;
@Bar::ISA = 'Foo';
sub foobared {
my $self = shift;
$self->{foo} = $self->_test( 3 );
}
package Main;
my $o = Foo->new;
$o->foobared;
print $o->{foo},$/;
my $o2 = Bar->new;
$o2->foobared;
print $o2->{foo};
##
##
3
Bar=HASH(0xa065cc8)