I see. I have followed that to the best I can, and I am looking deeper into the PObject code. Actually the save() method does seem to be here after all. Doing a class listing with stvns* recursing class lister I get,

MyHuman ------------------------------------------- humanthingysub myStorableBase ------------------------------------------- name phone pobject email parentthingysub id Class::PObject::Template ------------------------------------------- errstr remove __props save logtrc new load fetch count confess () columns dump remove_all ("" get set logconfig __driver croak carp drop_datasource

I've labelled human and parent thingies which are markers for methods in places I want to extend. So, we do inherit from ::Template and we get save() into the bargain, but unlike using an instance at the top level which saves and loads just fine I get a runtime error (which I've been seeing as a missing save() all along). Something else is up...OK, the context of use is,
#!/usr/bin/perl use MyHuman; my $person = MyHuman->new(); $person->name('bob'); $person->email('bob@bob.com'); $new_id = $person->save() or die "save bork"; my $newperson = MyHuman->load($new_id) or die "reload bork";; print "reload OK\nname is: ".$person->name()."\n";


..and we get a runtime,

Can't locate Class/PObject/Driver/.pm in @INC...

So my understanding is that its creating an instance just fine.Somehow the definition of the db_file and path are getting lost?
___________________________
*  A little while back another monk posted a very useful tool which has been invaluable to me experimenting with more adventurous OO Perl. I can't find the link, even in the supersearch, so I've posted the code again below. Note where I am using this to explore the inheritance of class myHuman.

#!/usr/bin/perl use strict; use warnings; no strict 'refs'; =pod # Class/Object Method Lister # on Jan 18, 2004 at 21:03 = by stvn # if you want certain methods ignored, # put their names in this string =cut my $IGNORE = ""; require MyHuman; printFlatClassView("MyHuman"); print "\n"; printExpandedClassView("MyHuman"); print "\n"; ## ------------------------------------------------------------------ sub getClassMethodList { my $class = shift; return grep { !/^($IGNORE)$/ && defined &{"${class}::$_"} } keys %{"${class}::"}; } ## ------------------------------------------------------------------ sub getCompleteClassMethodList { my ($class) = @_; my @methods = getClassMethodList($class); push @methods => map { getCompleteClassMethodList($_) } @{"${class}::ISA"}; return @methods; } ## ------------------------------------------------------------------ sub printExpandedClassView { my ($class, $tab_count) = @_; $tab_count ||= 0; if ($tab_count) { my $t = ("\t" x $tab_count); print "${t}$class\n"; print "${t}-------------------------------------------\n$t"; print join "\n${t}", getClassMethodList($class); print "\n"; } else { print("$class\n"); print "-------------------------------------------\n"; print join "\n" => getClassMethodList($class); print "\n"; } map { printExpandedClassView($_, $tab_count + 1) } @{"${class}::ISA"}; } sub printFlatClassView { my ($class) = @_; print("$class\n"); print "-------------------------------------------\n"; my %method = map { $_ => 1 } getCompleteClassMethodList($class); print join "\n" => keys %method; print "\n"; } ## ------------------------------------------------------------------ 1;
I've retititled more approppriately. I do appreciate all your help with this.
Andy.

In reply to Inheriting from Class::PObject by Anonymous Monk
in thread Can't inherit subroutines - workaround? by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.