note
hardburn
<p>I just ran your code on 5.8.4 i686-Linux with the same result you did. I'm not sure what is going on here--someone with more understanding of the internals is needed. My guess is that undef isn't staying shared like I expected it would.</p>
<p>It does work with taking a reference to undef, but this breaks the transparency I was hoping for:</P>
<code>
BEGIN {
&Internals::SvREADONLY(\undef, 0);
undef = 42;
&Internals::SvREADONLY(\undef, 1);
}
my $x = ${ \undef };
print( ((undef) ? 'True' : 'False'), $/);
print( ((defined undef) ? 'True' : 'False'), $/);
print( (($x) ? 'True' : 'False'), $/);
print( ((defined $x) ? 'True' : 'False'), $/);
print $x, $/;
__OUTPUT__
True
True
True
True
42
</code>
<!-- Node text goes above. Div tags should contain sig only -->
<div class="pmsig"><div class="pmsig-195718">
<p>"There is no shame in being self-taught, only in not trying to learn in the first place." -- Atrus, <i>Myst: The Book of D'ni</i>.</p>
</div></div>
410871
411006