perl593delta.pod says: "PERL_DONT_CREATE_GVSV,
introduced as an option
in perl 5.8.8, is turned on by default in perl 5.9.3. It
prevents perl
from creating an empty scalar with every new
typeglob."
But if this snippet is run with a fairly recent revision 5
version 9
subversion 5 patch 30104:
our $aScalar = 'aScalar';
our anArray = ( 'el0', 'el1' );
no strict 'refs';
print *{${'::'}}, "n";
print *{${'::'}}, '==', $aScalar,
"n";
print 'ARRAY ',
defined (*{${'::'}} ) ? 'defined' :
'undef', "n";
print *{${'::'}}, "n";
print *{${'::'}}, '==', anArray,
"n";
print 'SCALAR ',
defined (*{${'::'}} ) ? 'defined' :
'undef', "n";
it produces:
aScalar
SCALAR(0x95cf780)==SCALAR(0x95cf780)
ARRAY undef
anArray
ARRAY(0x95cf7d0)==ARRAY(0x95cf7d0)
SCALAR defined
PERL_DONT_CREATE_GVSV is in effect, and the SCALAR slot is
not
initialized in gv.c. Hence, the last line in the output is
quite
unexpected. Or has the SCALAR slot *access* been modified so
that the
old behaviour is still simulated?
Cheers
Wolfgang
|