Created
July 2, 2012 11:13
-
-
Save ynonp/3032735 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
use v5.14; | |
package Person::Types; | |
use Moose::Util::TypeConstraints; | |
enum 'Person::Types::EyeColor', [qw/gray brown green blue/]; | |
package Person; | |
use Moose; | |
use Moose::Util::TypeConstraints; | |
has 'eyecolor' => ( | |
is => 'ro', | |
isa => 'Person::Types::EyeColor', | |
); | |
package main; | |
my $p = Person->new( eyecolor => 'green' ); | |
my $q = Person->new( eyecolor => 'greeN' ); |
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 v5.14; | |
package Person; | |
use Moose; | |
use Moose::Util::TypeConstraints; | |
has 'eyecolor' => ( | |
is => 'ro', | |
isa => enum [qw/gray blue brown green/], | |
); | |
package main; | |
my $p = Person->new( eyecolor => 'green' ); |
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
gist: 3032412 | |
gist: 3032056 | |
gist: 3031636 | |
gist: 3031451 | |
gist: 3029901 | |
gist: 3029715 | |
gist: 3029693 | |
gist: 3029472 | |
gist: 3029432 | |
gist: 3029164 | |
gist: 3029139 | |
gist: 3028759 | |
gist: 3028758 | |
gist: cff21b913058a58389a9 | |
gist: 26bb64c76d5e40c5a525 moose | |
gist: 3009833 Bash Syntax Exercises | |
gist: 2877490 | |
gist: 2862674 Case bash example | |
gist: 2794368 indented heredoc example | |
gist: 2773724 | |
gist: 2633347 cool zombies | |
gist: 2566283 Unix Ex1 | |
gist: 66c84a9c27d246121ed1 | |
gist: e0ac3821bfae6369d042 anagrams.pl | |
gist: 33c6da4d24c9723a6881 golf | |
gist: 2486898 perl default var | |
gist: 2466264 html file | |
gist: 2462852 filters out expired certificates | |
gist: 1f15ffcde0264210efe2 golf head | |
gist: 2225265 | |
more... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment