Created
February 28, 2012 14:50
-
-
Save anonymous/1932931 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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