Skip to content

Instantly share code, notes, and snippets.

@ryan5500
Created August 4, 2009 13:54
Show Gist options
  • Save ryan5500/161237 to your computer and use it in GitHub Desktop.
Save ryan5500/161237 to your computer and use it in GitHub Desktop.
#!/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