Subject: | lazy { } 'init' is not lazy |
use Scalar::Lazy;
$\="\n";
my $var = lazy { print 'call'; 'val' } 'init';
print 'code';
print $var;
print $var;
# without 'init':
code
call
val
call
val
# with 'init' it's not lazy at all and print:
call
code
val
val
# instead of expected:
code
call
val
val