Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re: Two meanings of undefby davido (Cardinal) |
on Aug 16, 2020 at 03:04 UTC ( [id://11120801]=note: print w/replies, xml ) | Need Help?? |
This produces:
The reason I used string eval is because if Perl catches wind of $xyz in the source code it already will populate the symbol table. By using eval I'm able to defer Perl's knowledge of it until just in time. The point is that undef $xyz; doesn't remove the entry from the symbol table. Presumably you could do it manually: delete $::{'xyz'};, but you'll also obliterate any other entities that share the same symbol. Possible candidates include a hash, an array, a filehandle, or code, if any exist in the same namespace by the same name. Dave
In Section
Seekers of Perl Wisdom
|
|