Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Delegating to a role in Moose

by nysus (Parson)
on Jan 12, 2018 at 08:42 UTC ( [id://1207142]=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    { package Server;
    
    ...
    my $server = Server->new(ssh => Net::OpenSSH->new('me@10.0.1.22'));
    print $server->grab('ls');
    
  2. or download this
    You can use a role name as the value of handles:
    
    ...
      );
    
    Moose will introspect the role to determine what methods it provides a
    +nd create a name-for-name mapping for each of those methods.
    
  3. or download this
      has 'ssh' => (is => 'ro', isa => 'Net::OpenSSH', required => 1, hand
    +les => 'MyOpenSSH', );
    
  4. or download this
    You cannot overwrite a locally defined method (grab) with a delegation
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (4)
As of 2024-03-29 00:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found