Re: Clearing globals

2003-12-16 Thread Stas Bekman
Chris Ochs wrote: Will this work to undefine everything in package Test ? sub ClearGlobals { my $globalspace = "Test"; foreach (keys %{"${globalspace}::"}) { unless ($_ eq 'dbh') { ## Don't undef the cached database handle! local *symbol = "${globalspace}::${_}"; undef $symbol

Clearing globals

2003-12-16 Thread Chris Ochs
Will this work to undefine everything in package Test ? sub ClearGlobals { my $globalspace = "Test"; foreach (keys %{"${globalspace}::"}) { unless ($_ eq 'dbh') { ## Don't undef the cached database handle! local *symbol = "${globalspace}::${_}"; undef $symbol; undef @sym