Caillte has asked for the wisdom of the Perl Monks concerning the following question:
A bit of a puzzler, this one. I wish to use some OO code that I developed in linux on windows 2000 professional running activestate perl 5.6 build 620. When I moved it over though I found that child objects appeared not to be inheriting subs from their parents. An example that works on Red Hat Linux but will not on Win32 is given below.
Below is the code:
The parent object, stored in Base.pm
#The base object, Base.pm package Base; sub new { my $class = shift; my $self = {}; $class = ref($class) || $class; bless $self, $class; return $self; } 1; # The child object - qwe.html package qwe; use Base; @ISA = ("Base"); 1; # A test program #!/usr/bin/perl -w use qwe; my $x = new qwe();
When run on Win2000 perl returns the error Can't locate object method "new" via package "qwe" at test.pl line 6. Has anyone else run into this problem?
$japh->{'Caillte'} = $me;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(tye)Re: OO Inheritance in Win32
by tye (Sage) on Feb 28, 2001 at 21:45 UTC | |
by Caillte (Friar) on Feb 28, 2001 at 22:06 UTC | |
by tye (Sage) on Feb 28, 2001 at 22:33 UTC | |
by Caillte (Friar) on Feb 28, 2001 at 22:39 UTC | |
|
Re: OO Inheritance in Win32
by merlyn (Sage) on Feb 28, 2001 at 21:32 UTC | |
by Caillte (Friar) on Feb 28, 2001 at 22:01 UTC |