note
scrottie
<div class="pmsig_211039">
<code>
sub f {
my $x = shift;
*z = $x;
}
f({});
f();
</code>
Dave Mitchell solved this within a week and gave this
description:
"the second call to f() has $x as type RV (due to the previous call), but
!ROK - due to the undef assignment. sv_setsv_flags() didn't check for
ROK in this context."
This was discovered while writing Object::Lexical. It
stuffs closures into a stash created to represent an
object - each object is its own blessed stash. I assumed
(incorrectly) that the problem had something to do
with blessing stashes.
The fix is in 5.8.1.
Hats off to the Perl 5 Porters! You guys rock!
-scott
</div>
293886
293886