package Trait::LifeGuard; sub swim { return Trait::LifeGuard::_swim(); } sub save_drowning_swimmer { my (undef, $swimmer) = @_; # save the swimmer } 1; package Trait::Dog; Class::Trait->expects('doggie_treat'); sub swim { # $class might actually be an instance, but we should assume # nothing about the internals of the object my ($class, $target) = @_; Trait::Dog::_eat($class->doggie_treat); # swim to $target } sub _eat { # this must be called via a fully qualified name because private # methods are not flattened into the primary class } 1;