Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Moose Handles and Roles

by elTriberium (Friar)
on Jun 16, 2011 at 23:02 UTC ( [id://910048]=perlquestion: print w/replies, xml ) Need Help??

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.
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://910048]
Approved by ikegami
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (2)
As of 2024-04-24 13:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found