in reply to flavors of "defined"
You might be looking for ref()
> perl -e '$u='hallo'; print ref($u),"\n"; ' > perl -e '$u=\'hallo'; print ref($u),"\n"; ' SCALAR
UPDATE: Misread your question. You are looking for the symbol table hashes
> perl -e ' if (exists $main::{"u"}) { print "yes\n"; } ' > perl -e '$u='hallo'; if (exists $main::{"u"}) { print "yes\n"; } ' yes
|
|---|