in reply to VarStructor 1.0
Coming back to look at your code I realize your code has little to do with reset. It is not clear to me what you want your code to do, but rather than try to find your program and parse it, I would suggest you might walk the symbol table and read scratchpads if need be.
Be well.
sub r_reset { # This routine emulates the Perl CORE reset function # which is deprecated. It does not work without an # argument as ?? ops are also deprecated. die "Wrong args to r_reset" unless 1 == @_; my $chr = shift; die "Invalid characters in arg to r_reset" unless $chr =~ /^[-\w]+$/; die "Uppercase characters in arg to r_reset" if $chr =~ /[A-Z]/; my $pkg = caller(); no strict 'refs'; foreach my $var (grep /^[$chr]/, keys %{"$pkg" ."::"}){ undef ${$pkg . '::' . $var}; undef @{$pkg . '::' . $var}; undef %{$pkg . '::' . $var}; } }
|
---|