Viljo Marrandi actually wrote:
> my $r = shift;
> use vars qw( $log );
> $log = $r->log();
>
> if ( $some_case eq 'true' ) {
> use Sub::First qw( $log );
I haven't tested, but this doesn't look as a good idea.
I don't think your code does what you think it does
(or what you think it should do.) Moreover I don't
know what this actually does (or should do) precisely.
Exporter essentially does this:
*Site::log = \$Sub::First::log;
and vars essentially does this:
*Site::log = \$Site::log;
And this symbol table manipulation occurs at compile-time,
before your code is run (without scoping effecs).
In other words don't do that.
--
Rafael Garcia-Suarez