Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Which gives me a myStorable that I am happy with. In another file we have,#!/usr/bin/perl package myStorableBase; use Class::PObject; my @basedef = ["id", "name", "email", "phone"]; pobject # pobj is a persistent object { # can be saved and loaded columns => @basedef, # the entries driver => 'db_file', # to a db file normal unix datasource => "./data" # in this place }; sub thingysub { my $whatever = shift; return 1; } 1;
Human has a number of attributes and accessor/inspector methods that I've stripped out for clarity. However when I use myHuman I can's save the blighter, because it seems myHuman knows nothing about the subclass Class::PObject::DBM from which it gets its save(). I'm also confused becasue PObject doesn't seem to have a new constructor, it constructs a new instance using a subroutine 'pobject()' which I think is the source of all my woes. I need a PObject master, the docs don't say a lot about subclassing. Beat me with a cluebat! (or some more advanced Perl OO reading links) Cheers, Andy#!/usr/bin/perl package MyHuman; use myStorableBase; @ISA = ("myStorableBase"); # I am one of those cocky little monkeys with the hands and the fire a +nd the little green # pieces of paper. (aka 'Ugly Bag of mostly-water') # 1;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Can't inherit subroutines - workaround?
by simonm (Vicar) on May 08, 2004 at 20:56 UTC | |
by Anonymous Monk on May 08, 2004 at 21:17 UTC | |
by simonm (Vicar) on May 08, 2004 at 23:21 UTC | |
by Anonymous Monk on May 09, 2004 at 01:31 UTC | |
by simonm (Vicar) on May 09, 2004 at 07:03 UTC | |
|