Attribute delegation
- A slightly more complex example:
has 'logger' => (
is => 'ro',
isa => 'My::Custom::Logger',
required => 1,
handles => {
write_to_log => 'log',
flush_log_output => 'flush',
}
);
- The write_to_log and flush_log_output methods are added to the class
- delegating to the log and flush methods respectively