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.
It does work with taking a reference to undef, but this breaks the transparency I was hoping for:
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
"There is no shame in being self-taught, only in not trying to learn in the first place." -- Atrus, Myst: The Book of D'ni.