in reply to Inheritance not working...
My guess is that you have these packages inline in your program, declared below your actual program code. If that is the case, the problem is likely to be that the line:
is not getting executed - don't forget that an assignment like that happens at runtime, not at compile time.@objFood::ISA = qw(Object);
If you put your packages in a separate file and load them via "use" or "require", file-scope statements like that will get executed at the point the package is loaded. Alternatively, while the packages remain inline in the script you can either move the @ISA assignment earlier in the script, or wrap it in a BEGIN block:
HugoBEGIN { @objFood::ISA = qw(Object); }
|
|---|