Skip to content

Instantly share code, notes, and snippets.

@ingydotnet
Created May 25, 2011 11:29
Show Gist options
  • Save ingydotnet/990807 to your computer and use it in GitHub Desktop.
Save ingydotnet/990807 to your computer and use it in GitHub Desktop.
package Foo;
use Moo;
has x => is => ro => default => sub { 'O HAI' };
has y => is => ro => builder => '_build_y'; #, lazy => 1;
sub _build_y {
my $self = shift;
print $self->x, "\n";
}
package main;
Foo->new->y;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment