Skip to content

Instantly share code, notes, and snippets.

Created February 28, 2012 14:50
Show Gist options
  • Save anonymous/1932931 to your computer and use it in GitHub Desktop.
Save anonymous/1932931 to your computer and use it in GitHub Desktop.
package Father;
$VERSION = "0.01";
sub new {
my $self = {};
bless $self;
return $self;
};
sub _internal {
print "calling Father::_internal\n";
};
sub public {
shift->_internal();
};
1;
# ====================================
package Child;
use base Father;
$VERSION = "0.01";
sub new {
# my $self = shift->SUPER::new(@_);
my $self = bless {}, shift;
$self->SUPER::new(@_);
}
sub _internal {
print "calling Child::_internal\n";
};
# =============================
use Child;
$a = new Child;
$a->_internal();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment