Beefy Boxes and Bandwidth Generously Provided by pair Networks Bob
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: VarStructor 1.0

by rir (Vicar)
on Jun 03, 2004 at 22:47 UTC ( [id://360643]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to VarStructor 1.0

I read your post far enough to realize you were ostensibly writing a replacement for reset. Though I have used Perl since PERL days I had no idea what reset did. Looking it up, I wrote the following.

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}; } }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://360643]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.