{
my
%public_of
:ATTR( :init_arg<pub> );
my
%private_of
:ATTR;
sub
BUILD {
my
(
$self
,
$ident
) =
@_
;
$private_of
{
$ident
} =
'base priv'
;
}
}
{
my
%public_of
:ATTR( :init_arg<pub> );
my
%private_of
:ATTR;
sub
BUILD {
my
(
$self
,
$ident
) =
@_
;
$private_of
{
$ident
} =
'der priv'
;
}
}
my
$rep
= MyDer->new({
MyBase
=> {
pub
=>
'base pub'
},
MyDer
=> {
pub
=>
'der pub'
},
})->_DUMP;
my
$hash
=
eval
$rep
;
ok !
ref
$rep
=>
'Representation is string'
;
ok
$hash
=>
'Representation is valid'
;
is
$hash
->{MyBase}{pub},
'base pub'
=>
'Public base attribute'
;
is
$hash
->{MyBase}{
'????'
},
'base priv'
=>
'Private base attribute'
;
is
$hash
->{MyDer}{pub},
'der pub'
=>
'Public derived attribute'
;
is
$hash
->{MyDer}{
'????'
},
'der priv'
=>
'Private derived attribute'
;