in reply to inheritance turns back and bites
as others said already, in MyNumber, you have implemented the method add different
from the one in SomeData. you have to decide which one you want.
also, in the new method of SomeData, you have a little error.
if you do
sub new { bless \pop, shift }
it's like doing
sub new { bless \42, "MyNumber" }
and you can't bless a constant into an object.
so do my $arg = pop; bless \$arg, shift
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: inheritance turns back and bites
by dada (Chaplain) on Mar 01, 2004 at 13:57 UTC | |
by tinita (Parson) on Mar 01, 2004 at 14:04 UTC | |
Re: Re: inheritance turns back and bites
by borisz (Canon) on Mar 01, 2004 at 13:51 UTC | |
by tinita (Parson) on Mar 01, 2004 at 14:01 UTC | |
by dada (Chaplain) on Mar 01, 2004 at 14:18 UTC | |
by borisz (Canon) on Mar 01, 2004 at 14:07 UTC | |
by tinita (Parson) on Mar 01, 2004 at 14:18 UTC |
In Section
Seekers of Perl Wisdom