Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

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

by broquaint (Abbot)
on Aug 10, 2005 at 15:02 UTC ( #482617=note: print w/ replies, xml ) Need Help??


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

Suppose I were creating dynamic packages at runtime and I want to make sure all the stuff in them gets destroyed. How would I ensure that?
If you want to delete a symbol table then use the delete_package function from Symbol e.g
use Symbol 'delete_package'; use Data::Dumper; $Yakkity::Yak::a = 42; print "a = $Yakkity::Yak::a\n"; print Dumper \%Yakkity::Yak::; print "Undeffing symbol table\n"; delete_package 'Yakkity::Yak'; print "a = $Yakkity::Yak::a\n"; print Dumper \%Yakkity::Yak::; __output__ a = 42 $VAR1 = { 'a' => *Yakkity::Yak::a }; Undeffing symbol table a = $VAR1 = {};
HTH

_________
broquaint


Comment on Re: Undefining symbol tables and globs and things, oh my
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2014-07-13 18:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (251 votes), past polls