I found that a modified version of scrub_package
(written by Mark-Jason Dominus and described in perlfaq7)
works correctly and more efficiently than
Apache::PerlRun-flush_namespace
Here is the original scrub_package subroutine:
sub scrub_package {
no strict 'refs';
On Mon, 1 May 2000, Richard Chen wrote:
Hello,
I am having a problem clearing variables and aliases
in a temporary package name space. The source of the problem
is in making legend cgi scripts work under Apache::Registry.
But the problem can be isolated and shown by the following
Unfortunately, the crucial part about clearing/removing
subroutine alias does not work when using
Apache::PerlRun-flush_namespace('Q')
I suspect this is a bug in PerlRun. Here is the demo program
(It can be run from the command line)
$ cat tmp.pl
#!/usr/bin/perl -w
use strict;
use
Hello,
I am having a problem clearing variables and aliases
in a temporary package name space. The source of the problem
is in making legend cgi scripts work under Apache::Registry.
But the problem can be isolated and shown by the following
demo program:
$ cat foo.cgi
#!/usr/bin/perl -w