Subject: | False postive class_loaded despite module death |
There's an annoying condition that arrises ( on all Perls so far :( ) that if a module manages to populate ISA before it dies, then it will appear to be a valid module.
And whats worse, is it trips our heuristics in both old and new perls!
https://github.com/kentfredric/class-load/compare/master...ISA_FalsePositive
Has 2 tests ( both for using 'die' and actual syntax errors, both cause the behaviour )
I'm not sure how to resolve this at present.
Stepping through with the debugger pointed me to this line returning true:
sub is_class_loaded {
...
return 1 if exists ${$$pack}{ISA}
&& defined *{${$$pack}{ISA}}{ARRAY};
which results in
sub try_load_class {
...
return 1 if is_class_loaded($class);
And whats worse, is it trips our heuristics in both old and new perls!
https://github.com/kentfredric/class-load/compare/master...ISA_FalsePositive
Has 2 tests ( both for using 'die' and actual syntax errors, both cause the behaviour )
I'm not sure how to resolve this at present.
Stepping through with the debugger pointed me to this line returning true:
sub is_class_loaded {
...
return 1 if exists ${$$pack}{ISA}
&& defined *{${$$pack}{ISA}}{ARRAY};
which results in
sub try_load_class {
...
return 1 if is_class_loaded($class);