[tpm] Stupid question time... Why does @ISA have to be scoped global?
Madison Kelly
linux at alteeve.com
Fri Aug 14 09:46:09 PDT 2009
As I understand it, when you have a package like:
package Aaa::Bbb;
use Aaa::Bbb::Foo;
our @ISA=("Aaa::Bbb::Foo");
...
Package "Aaa::Bbb" will consult it's @ISA to look for packages to look
for methods in when it doesn't have the requested method itself. As I
understand it, this would make me think only that package accesses the
@ISA array. So why then does 'perlmod' say:
Such a package may also derive some of its methods from another class
(package) by listing the other package name(s) in its global @ISA array
(which must be a package global, not a lexical).
I've never liked the answer "Just because", so thanks in advance for
helping to placate my curiosity. :)
Madi
More information about the toronto-pm
mailing list