in reply to Re: detecting an undefined variable
in thread detecting an undefined variable
> Exists refers to keys in a hash and has nothing to do with variables.
this statement is problematic because Perl's namespaces - including scratchpads° - are actually implemented as hashes.
for instance it's perfectly possible to check the STASH for a package variable
DB<3> p exists $main::{xxx} DB<4> $xxx = 1 DB<5> p exists $main::{xxx} 1
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
FootballPerl is like chess, only without the dice
°) though you'd need PadWalker to access it.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: detecting an undefined variable
by Haarg (Priest) on Sep 21, 2019 at 20:45 UTC | |
by LanX (Saint) on Sep 21, 2019 at 21:20 UTC | |
|
Re^3: detecting an undefined variable
by LloydRice (Beadle) on Sep 21, 2019 at 16:50 UTC | |
by LanX (Saint) on Sep 21, 2019 at 17:02 UTC | |
by LloydRice (Beadle) on Sep 21, 2019 at 17:48 UTC | |
by AnomalousMonk (Archbishop) on Sep 21, 2019 at 20:25 UTC |