Created
November 1, 2010 08:14
-
-
Save aanoaa/657812 to your computer and use it in GitHub Desktop.
inheritance test in moose
This file contains hidden or 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 Foo; | |
use Moose; | |
has package => ( | |
is => 'ro', | |
isa => 'Str', | |
default => __PACKAGE__ | |
); | |
__PACKAGE__->meta->make_immutable; | |
package Bar; | |
use Moose; | |
extends 'Foo'; | |
__PACKAGE__->meta->make_immutable; | |
package main; | |
use strict; | |
use warnings; | |
my $foo = Bar->new; | |
print $foo->package, "\n"; # why 'Foo'? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment