Ok, that helped. Now, if I add this object:
Bah2.pm:
package Bah2;
use lib ".";
use Bah;
use strict;
our @ISA = qw(Bah); # inherits from Bah
# Create Object class instance
#my $Object = Object()->new();
sub new {
my ($class) = @_;
my $self = $class->SUPER::new(@_);
$self->{'_bah2'} = 0;
return $self;
}
sub printBah2 {
my $self = shift;
print "Bah2\n";
}
+
1
And I modify the test to use Bah2 I get:
Objects = $VAR1 = {
'Bah' => [
'new',
'printBah',
'new',
'toString'
],
'Bah2' => [
'new',
'printBah2'
]
};
So, the Object hash is missing! Well, Object's functions are now in Bah though... but would be nice to have the functions in their Object they came from.
Maybe the structure should be redone even more, so its an array with all the objects in the hiarchy. [0] is the current object, [
1] one up etc. Or opposite ([0] is the top one, [
1] subclass of [0] etc...) Functions may also need to be hashes, to remove duplicates...
What say you?
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.