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 @symbol;
      undef %symbol;
    }
  }
}

-- 
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html

Reply via email to