Help for this page

Select Code to Download


  1. or download this
    use Class::Trait 'LifeGuard';
    use Class::Trait 'Dog' => { explicit => 'swim' };
    
  2. or download this
    use Class::Trait (
                      'Trait::LifeGuard',
                      'Trait::Dog' => { explicit => 'swim' }
                      );
    
  3. or download this
    Class::Trait->promise('doggie_treat');
    Class::Trait->assemble; # this flattens the traits into this class
    ...
    sub AUTOLOAD {
     # we'll make &doggie_treat, if needed
    }
    
  4. or download this
    *{"${using_pkg}::$trait_method_name"} = \&{"${trait_pkg}::$trait_metho
    +d_name"}
    
  5. or download this
    package Person;
    
    ...
    }
    
    1;
    
  6. or download this
    
    package Trait::LifeGuard;
    ...
    }
    
    1;