in reply to What is a handler?

Here is a super trivial example. Even though my objects are derrived from a base class, they don't have to be ... the only real requirement is that they have some predetermined method, say handle(), that can be invoked:
package main; print $_->handle for (Bar->new, Baz->new); package Foo; sub new { return bless {}, shift } package Bar; use base 'Foo'; sub handle { return "Bar's handler was called\n" } package Baz; use base 'Foo'; sub handle { return "Baz's handler was called\n" }
This is also called polymorphism, by the way.

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)