sub baz { # baz is private ... goto &{$_[0]->can('SUPER::baz') || \&error} if caller ne __PACKAGE__; return "Hello from Bar::baz (private)"; }