Skip to content

Instantly share code, notes, and snippets.

@berekuk
Created April 16, 2013 16:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save berekuk/5397406 to your computer and use it in GitHub Desktop.
Save berekuk/5397406 to your computer and use it in GitHub Desktop.
Moo and false defaults
$ perl -MData::Dumper -E 'use Moo; has "foo" => (is => "ro", default => sub { 0 }); has "bar" => (is => "ro", default => 0); say Dumper(main->new)'
$VAR1 = bless( {
'foo' => 0
}, 'main' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment