Problems? Is your data what you think it is? | |
PerlMonks |
Re^2: Designing an OO program with multiple inherited classesby punkish (Priest) |
on Dec 09, 2009 at 15:08 UTC ( [id://811937]=note: print w/replies, xml ) | Need Help?? |
Thanks for the guidance above, but I am still not clear about the implementation. Is sub foo {} in a different package or in Obj.pm? I hope not the latter, because the whole point of the exercise is to separate Foo code into a separate package that still gets initialized via Obj.pm. In other words, in my script I want to call only Obj->new(), and as Obj->new() goes about initializing, parts of it are done elsewhere, in Foo, Bar, etc. The source of this problem is that I am trying to translate a rather large C program, and in doing so, I am trying to follow some of the original design choices. Since C has all the bits and pieces in separate .h and .c files, I am trying to respect that as much as possible. Of course, if they completely don't make any sense, or are not needed because of the magic of Perl, then I won't, but for the most part, I want to keep the code in small files, rather than all of it in one file. Also, while Moose may well solve my problem, and may well be the greatest thing since sliced hashes, I don't want to use Moose. Basically, I don't want to use external and complicated stuff, specially stuff I have to install and learn. Right now the only non-core Perl module I am using is DBI. I want it to remain that way. So, how can I implement hasa instead of isa with vanilla Perl? Thanks.
--
when small people start casting long shadows, it is time to go to bed
In Section
Seekers of Perl Wisdom
|
|