Subject: | Default scalars don't initialize when value is false |
I saw the blog post about 1.001 and noticed that 'default' supposedly accepted simple scalars now, but when I tried it my program died.
It works with defaults of a true value, but not false ones:
*$ perl -le 'use Moo; has ascalar => (is => "ro", default => 0); has asub => (is => "ro", default => sub {0}); my $m = main->new; print $m->asub; print $m->ascalar'
0
Use of uninitialized value in print at -e line 1.