Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

RE: Clearing a namespace

by vladdrak (Monk)
on Oct 04, 2000 at 04:44 UTC ( #35210=note: print w/replies, xml ) Need Help??


in reply to Clearing a namespace

If you _really_ wanted to wipe everything it seems like this would work (and possibly have weird-fun consequences). Of course, its not the Right Thing to do.
foreach $symname (sort keys %main::) { local *sym=$main::{$symname}; if defined $sym { undef $sym; print "\$$symname was undefined\n"; } if defined @sym { undef @sym; print "\@$symname was undefined\n"; } if defined %sym { undef %sym; print "\%$symname was undefined\n"; } }
-Vlad

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2023-01-29 14:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?