Created
July 1, 2012 18:05
-
-
Save ynonp/3029139 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
package Starship; | |
use Moose; | |
has 'captain', is => 'ro', isa => 'Str', required => 1; | |
has 'crew', is => 'rw', isa => 'ArrayRef[Str]', required => 1; | |
package main; | |
# Pass a hash ref to prevent copying | |
my $enterprise = Starship->new( { | |
captain => 'James T Kirk', | |
crew => ['Dr. McCoy', 'Scott', 'Lt. Uhura'], | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment