Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
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 making s'mores by the fire in the courtyard of the Monastery: (8)
As of 2014-10-02 06:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What is your favourite meta-syntactic variable name?














    Results (49 votes), past polls