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
==================*/




Reply via email to