my $code; { my @arr = (9) x 1000_000; $code = sub { @arr }; } # @arr kept alive by the sub undef $code; # @arr freed print(scalar(@arr), $/); # error under strict.