Created
December 13, 2010 09:31
-
-
Save tene/738830 to your computer and use it in GitHub Desktop.
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
[sweeks@sweeks-laptop treed-enum]$ perl -MLogger -E '$l = Logger->new(rgb=>"red"); say $l->rgb; Log->rawr' | |
red | |
lol ohai |
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
use MooseX::Declare; | |
use feature ':5.10'; | |
class Log { | |
use Moose::Util::TypeConstraints; | |
our $foo; | |
BEGIN { | |
enum 'RGB' => qw/red green blue/; | |
$foo = "lol ohai"; | |
} | |
use Logger; | |
sub rawr { | |
say $foo; | |
} | |
} |
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
use MooseX::Declare; | |
class Logger { | |
use Log; | |
has 'rgb' => ( isa => 'RGB', is => 'rw' ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment