http://www.perlmonks.org?node_id=11106513


in reply to Re^2: detecting an undefined variable
in thread detecting an undefined variable

That doesn't check if the variable exists though, it checks if the stash for that name is populated with anything. Having a sub or file handle with the same name would cause the stash entry to exist, usually stored inside a GLOB. While the other types can be detected, it isn't possible to distinguish between an undefined and non-existent scalar by inspecting a GLOB in pure perl.