pl@nereida:~/LEyapp/examples$ cat attributeprotected.pl #!/usr/local/bin/perl -w package SomeClass; use Attribute::Protected; sub foo : Public { } sub _bar : Private { } sub _baz : Protected { } sub another { my $self = shift; $self->foo; # OK $self->_bar; # OK $self->_baz; # OK } sub new { bless {}, $_[0] } package DerivedClass; @DerivedClass::ISA = qw(SomeClass); sub yetanother { my $self = shift; $self->foo; # OK $self->_bar; # NG: private method $self->_baz; # OK } package main; my $some = SomeClass->new; $some->foo; # OK print ($some->can('_bar')?"Yes, main can see that SomeClass has a _bar method\n":"no\n");