Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^2: Undefining symbol tables and globs and things, oh my

by ikegami (Patriarch)
on Aug 10, 2005 at 13:56 UTC ( [id://482602]=note: print w/replies, xml ) Need Help??


in reply to Re: Undefining symbol tables and globs and things, oh my
in thread Undefining symbol tables and globs and things, oh my

To illustrate dave_the_m's and Bob9000's point, compare

#!/usr/bin/perl $Yakkity::Yak::a = 42; print "a = $Yakkity::Yak::a\n"; print "Undeffing symbol table\n"; undef %Yakkity::Yak::; print "a = $Yakkity::Yak::a\n"; __END__ a = 42 Undeffing symbol table a = 42

with

#!/usr/bin/perl $Yakkity::Yak::a = 42; print "a = $Yakkity::Yak::a\n"; print "Undeffing symbol table\n"; undef %Yakkity::Yak::; print "a = ${'Yakkity::Yak::a'}\n"; # <- Hardcoded reference removed __END__ a = 42 Undeffing symbol table a =

The last reference to $Yakkity::Yak::a keeps the symbol alive. If the reference to one built at run-time, the symbol disappears along with the table.

Sorry, this post just explains what is seen, not how to work around it. Hopefully, someone has a solution.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://482602]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2024-04-19 05:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found