-
-
Save ktat/902a9996de10eb9e40b7 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