in reply to Re^3: Point me in the right direction with OO inheritance and static variables
in thread Point me in the right direction with OO inheritance and static variables
Thanks again, it all makes sense now!
I've since found that i have another problem though. I was running with an older version of perl(5.8.8) and it didn't like some of the code. I've since upgraded locally to 5.20 and i've had to recompile my local modules but i think i have it working now.
The problem that i'm having is that my script can't find the parent class file.
In my main script i have the following:
use ChildObjects; use ParentObjects;
I then have the 2 files: ChildObjects.pm and ParentObjects.pm
Inside the ParentObjects.pm file i have:
package ParentObjects;Inside the ChildObjects.pm file i have:
package ChildObjects; use parent -norequire, "ParentObjects";
When i then try in my script: my $obj=ChildObjects->new(); But i get the following error from my script: Can't locate package ParentObjects for @ChildObjects::ISA at ./script.pl line 54
Can you help? Am i naming/calling my package files wrong?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Point me in the right direction with OO inheritance and static variables
by tobyink (Canon) on Sep 02, 2014 at 19:11 UTC | |
by Amblikai (Scribe) on Sep 10, 2014 at 09:46 UTC | |
by tobyink (Canon) on Sep 10, 2014 at 20:37 UTC | |
|
Re^5: Point me in the right direction with OO inheritance and static variables
by tangent (Parson) on Sep 02, 2014 at 19:10 UTC |