Created
June 12, 2015 03:29
-
-
Save S2/bcdc6aafdb831b9d8f44 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
#!/usr/bin/env perl | |
package Hoge{ | |
sub new { | |
my $class = shift; | |
my $args = ref $_[0] ? $_[0] : +{@_}; | |
$args->{package} = __PACKAGE__; | |
bless $args, $class; | |
} | |
sub say_package{ | |
shift->{package}; | |
} | |
} | |
package Fuga{ | |
use base qw/Hoge/; | |
} | |
package main; | |
say new Fuga->say_package(); # Fugaって出て欲しいのにHogeって出る |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment