Created
August 4, 2009 13:54
-
-
Save ryan5500/161237 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 Coffee; | |
use Moose; | |
has 'beans' => ( | |
is => 'rw', | |
isa => 'ArrayRef' | |
); | |
__PACKAGE__->meta->make_immutable; | |
no Moose; | |
sub list { | |
my $self = shift; | |
my $beans = $self->beans; | |
foreach my $bean (@$beans) { | |
print "list :: $bean\n"; | |
} | |
} | |
1; | |
package main; | |
use strict; | |
my @arr = ['hoge', 'fuga']; | |
my $c = Coffee->new(beans => @arr); | |
$c->list; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment