http://qs321.pair.com?node_id=1207200


in reply to Re^4: Delegating to a role in Moose
in thread Delegating to a role in Moose

Well this is what the docs say:
With the role option, you specify the name of a role or a role type whose "interface" then becomes the list of methods to handle. The "interface" can be defined as; the methods of the role and any required methods of the role. It should be noted that this does not include any method modifiers or generated attribute methods (which is consistent with role composition).
So in your example
has 'uri' => ( is => 'ro', isa => 'URI', handles => 'MyURIRole', );
means that the methods of MyURIRole i.e. 'host', 'path' and 'print_hi' will be delegated to the 'uri' attribute, which in this case is an object of class "URI::http" and that class doesn't provide a "print_hi" method.

To reiterate, MyURIRole is only being used by 'handles' in an informational way (i.e. to determine the names of delegated methods), it does not use the role to provide the method implementations.