Help for this page

Select Code to Download


  1. or download this
    # TestRole role:
    package TestRole;
    ...
    $c->add_something("123");
    my @arr = $c->test_method();
    print Dumper(\@arr) . "\n";
    
  2. or download this
    'TestRole' requires the method 'test_method' to be implemented by 'Con
    +sumer'
    
  3. or download this
        handles => {
            test_method => 'elements',
            add_something => 'push',
        },
    
  4. or download this
    sub add_something {
       my ($self, %args) = @_;
    ...
    sub test_method {
       # add the 'elements' code here.
    }