Okay, so what I've been doing lately at least a couple of people saw at YAPC:
- Writing a class that uses Module::Pluggable to allow you to build command plugins for the debugger.
- Writing a wrapper class for WWW::Mechanize that allows you to write plugins to add functions to and modify the operation of Mech
The tricky bit here in both cases is doing it without touching the base code at all. If you're interested in the gory details, see
Devel::Command and
WWW::Mechanize::Pluggable on CPAN.
I'm currently looking at the possibility of extracting all the special-purpose code in
WWW::Mechanize::Pluggable into a pair of base classes -
Class::Pluggability and
Class::Pluggability::Plugbase, so anybody can write a pluggable wrapper for
any module whatsoever.
And this is actually part of my actual job - woo! I'm having fun.