Subject: | "no indirect" leaking into eval |
I found a case where "no indirect" is leaking out of it's lexical scope
and into evals. If you load the attached module in the presence of "no
indirect" it will fail with:
Indirect call of method "import" on object "Test::Warn" at (eval 31) line 1.
Indirect call of method "import" on object "Test::Exception" at (eval
32) line 1.
Indirect call of method "import" on object "Test::Differences" at (eval
33) line 1.
Indirect call of method "import" on object "Test::Deep" at (eval 34) line 1.
These appear to stem from this line in Test::Most:
eval "require $module; import $module $exclude_symbols;";
which is using an indirect method call, but is not in indirect's scope.
What's interesting is this is not a problem with loading Test::Most
directly. It only happens when Test::Most->import is called and then
called again inside an import at BEGIN time. Removing either the BEGIN
block or the call to import from test.plx makes the problem go away.
Hope that's enough info. perl -V attached.
Subject: | TestMost.pm |
package TestMost;
# Import Test::Most's symbols and re-export them
require Test::Most;
Test::Most->import;
Test::Most->import;
sub import {
Test::Most->import;
}
1;
Subject: | perlV.out |
Message body not shown because it is not plain text.
Subject: | test.plx |
Message body not shown because it is not plain text.