A little bit of an odd question. I'm experimenting with inheritance and I can get it to work as long as I set the variables in the instance of the child class since the self object that contains the variable will be passed to the parents function that I'm calling. IE the child module has the variable VERSION that I set in the new function to $self->{VERSION} = VERSION. The parent module has the method sub GetVersion() that prints the version of the module.
What I'm trying to figure out, is if there is any way to have the modules variable $VERSION accessible from a parent class without setting it in the instance? The only thing I can think of to do it is to have the parent include that module at the time I need the version but that kind seems like a hack.
Any other ideas?
In reply to Perl Inheritance & module variables by diabelek
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |