Mandor has asked for the wisdom of the Perl Monks concerning the following question:
Now I expect the following to work.file - Project\Client.pm package Project::Client; use strict; sub new { my ($class, %args) = shift; $class = ref ($class) || $class; my $self = {}; ... bless ($self, $class); return $self; } ... file - Project\Client\Mode.pm package Project::Client::Mode; @ISA = ('Project::Client'); use strict; ... file - Project\Client\Mode\TestMode.pm package Project::Client::Mode::TestMode; @ISA = ('Project::Client::Mode'); use strict; ...
But I get the dreaded 'Can't locate object method "new" via package "Project::Client::Mode::TestMode"'file - client.pl use strict; use lib '...'; my $mode = Project::Client::Mode::TestMode -> new (...); ...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
•Re: Inheritance not working
by merlyn (Sage) on Mar 23, 2002 at 15:58 UTC | |
|
Re: Inheritance not working
by mattriff (Chaplain) on Mar 23, 2002 at 15:51 UTC | |
|
Re: Inheritance not working
by Kanji (Parson) on Mar 23, 2002 at 15:52 UTC | |
|
Re: Inheritance not working
by jepri (Parson) on Mar 23, 2002 at 16:38 UTC | |
by chromatic (Archbishop) on Mar 23, 2002 at 18:22 UTC | |
|
Re: Inheritance not working
by dreadpiratepeter (Priest) on Mar 23, 2002 at 15:53 UTC | |
|
Re: Inheritance not working
by trs80 (Priest) on Mar 23, 2002 at 19:45 UTC |