in reply to package symbol table syntax?
... indicate that the expression is a CODE(xxxxx) reference. Shouldn't it be a GLOB?With both 5.6.1 and 5.8.0 I get nothing, unless VERSION is defined in some way, in which case I get a stringified version of the glob
You would only get something like GLOB(0x000000) if you were stringifying a reference to a GLOB. e.gshell> perl -e 'print "what? [", $main::{'VERSION'}, "]\n";' what? [] shell> perl5.8.0 -e 'print "what? [", $main::{'VERSION'}, "]\n";' what? [] shell> perl -e '$VERSION=1; \ print "what? [", $main::{'VERSION'}, "]\n";' what? [*main::VERSION] shell> perl5.8.0 -e '$VERSION=1; \ print "what? [", $main::{'VERSION'}, "]\n";' what? [*main::VERSION]
And to get something like CODE(0x000000) we need to access the CODE slot of the globshell> perl -e '$VERSION=1; \ print "what? [", \$main::{'VERSION'}, "]\n";' what? [GLOB(0x806151c)]
shell> perl -e 'sub VERSION {} \ print "what? [", *main::VERSION{CODE}, "]\n";' what? [CODE(0x8107f30)]
_________
broquaint
|
|---|