Oh! I wasn't clear that you controlled both. You could do a form of protected access that returns a reference to the structure. (Breaking encapsulation in a limited way).
# in MathML::Entities my %ENTITIES; sub _get_entity_hash { my $caller = caller; if ( $caller->isa("MathML::Entities") ) { return \%ENTITIES; } else { die "_get_entity_hash can't be called from $caller" } }
-xdg
Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.
In reply to Re^5: Modifying/extending a superclass' data
by xdg
in thread Modifying/extending a superclass' data
by kiz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |