On 1 Sep 2000, Perl6 RFC Librarian wrote: > Private entries of hashes could be I<indirectly> accessed in packages > that inherit from the entry's package, by qualifying (i.e. prefixing) the > key with the entry's package name. For example: > > package Base; > > sub new { > my ($class, @data) = @_; > bless private { data => [@data] }, $class; > } > > > package SortableBase; > use base 'Base'; > > sub sorted { > my ($self) = @_; > print sort @{ $self->{Base::data} }; > } Gack! This is in fact the reason I'm avoiding Tie::SecureHash, which is otherwise well suited to my needs. If I'm several lays deep in a hierarchy it seems awfully onerous for me to have to know which ancestor my hash keys came from. I would find a 'protected' keyword that did the same thing but allowed unqualified access to child classes _much_ more useful. I think both would be best. -dave /*================== www.urth.org We await the New Sun ==================*/
- Re: RFC 188 (v1) Objects : Private keys and methods John Siracusa
- Re: RFC 188 (v1) Objects : Private keys and metho... Piers Cawley
- Re: RFC 188 (v1) Objects : Private keys and methods Kenneth Lee
- Re: RFC 188 (v1) Objects : Private keys and methods Kenneth Lee
- Re: RFC 188 (v1) Objects : Private keys and methods Damian Conway
- Re: RFC 188 (v1) Objects : Private keys and methods David E. Wheeler
- Re: RFC 188 (v1) Objects : Private keys and metho... Piers Cawley
- Re: RFC 188 (v1) Objects : Private keys and methods Nathan Wiger
- Re: RFC 188 (v1) Objects : Private keys and methods Damian Conway
- Re: RFC 188 (v1) Objects : Private keys and methods Dave Rolsky
- Re: RFC 188 (v1) Objects : Private keys and methods Jonathan Scott Duff
- Re: RFC 188 (v1) Objects : Private keys and methods Damian Conway
- Re: RFC 188 (v1) Objects : Private keys and metho... Tom Christiansen
- Re: RFC 188 (v1) Objects : Private keys and m... Bart Lateur
- Re: RFC 188 (v1) Objects : Private keys a... Tom Christiansen
- Re: RFC 188 (v1) Objects : Private keys and metho... Jonathan Scott Duff
- Re: RFC 188 (v1) Objects : Private keys and metho... Damian Conway
- Re: RFC 188 (v1) Objects : Private keys and methods Glenn Linderman
- Re: RFC 188 (v1) Objects : Private keys and methods Damian Conway
- Re: RFC 188 (v1) Objects : Private keys and methods Damian Conway