Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
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 chanting in the Monastery: (3)
As of 2015-07-28 01:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (251 votes), past polls