sub PROTECTED { my $self = shift; my @caller = caller(1); $caller[3] =~ m{(.*)::(.*)$}; my ($pack, $sub) = ($1,$2); local $Carp::CarpLevel += 1; confess "method '$sub' is protected by '$pack'" unless ($caller[0]->can($sub)); return $self; }