We don't bite newbies here... much | |
PerlMonks |
Re^3: detecting an undefined variableby Haarg (Priest) |
on Sep 21, 2019 at 20:45 UTC ( [id://11106513]=note: print w/replies, xml ) | Need Help?? |
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.
In Section
Seekers of Perl Wisdom
|
|