I've checked .....
Given the following code
I get the result
Don Federico Jesus Pichon Alvarez is age 47.
His peers are: PEON=FRANK, PEON=FELIPE, PEON=FAUST
here is the boss
$VAR1 = bless( {
'ID' => undef,
'PEERS' => [
'Frank',
'Felipe',
'Faust'
],
'NAME' => undef,
'AGE' => 47,
'SALARY' => 40000,
'_CENSUS' => \1,
'FULLNAME' => bless( {
'SURNAME' => 'Pichon Alvarez',
'TITLE' => 'Don',
'CHRISTIAN' => 'Federico Jesus
+',
'NICK' => 'Fred'
}, 'Fullname' )
}, 'Boss1' );
Destroying $self Fred at ./testboss1.pl line 0
All persons are going away now
Boss1 inherits Employee4 which in turn inherits Person5. Neither Boss1 nor Employee4 bless.
When a new Boss1 is instantiated the Employee4 constructor is called which in turn calls the Person5 constructor.
The value of $class in both Person5 and Employee4 is Boss1.
So Person5 artifacts (methods, globals and data) are blessed into the Boss1 class as are Employee4 artifacts.
This would indicate that reblessing isn't entirely necessary, even when subclassing.
But it might be reckless to assume that blessing occurs somewhere in the hierarchy.
|