Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re: @ISA, Inheritance, and Class Methodsby btrott (Parson) |
on Mar 13, 2001 at 10:35 UTC ( [id://64074]=note: print w/replies, xml ) | Need Help?? |
You say:
No it's not. That's not a class method--that's a fully-qualified subroutine 'whiz' in the class 'Foo::BarMod'. Very much not a class method. You're saying, "call the function 'whiz' in the package 'Foo::BarMod'". But such a function doesn't exist, so Perl doesn't like that. If you want inheritance, call it as a class method, which is calling it like this: (Or indirect object syntax, but that's generally not used much.) In other words: you came to the right conclusion, but you may have spared yourself quite a bit of confusion and frustration if you had your terms right. Inheritance--ie., checking in @ISA--only occurs for class methods (and object methods). Not for fully-qualified subroutines.
In Section
Meditations
|
|