in reply to Re: Exported subroutine redefine
in thread Exported subroutine redefine
I just ended up walking the entire symbol table, which turned out to be a trivial subroutine. Please let me know if I am doing something horribly wrong (the justification can be found in the big picture)
_redef(); sub _redef { my $parent = shift || '::'; for my $ns (grep /^\w+::/, keys %{$parent}) { $ns = $parent . $ns; _redef($ns) unless $ns eq '::main::'; for my $sub (keys %redef) { *{$ns . $sub} = $redef{$sub} if (exists ${$ns}{$sub}); } } }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Exported subroutine redefine
by joey (Initiate) on Oct 21, 2008 at 22:04 UTC |
In Section
Seekers of Perl Wisdom