in reply to How Are Attributes Useful?
and your plugins look likepackage Something::Pluggable; use base qw(Class::Autoplug::Pluggable); 1;
All the monkey code to find the methods, add hooks, etc., is handled inside the base classes, letting you concentrate on the actual job at hand. Attributes make it easy to define what you want declaratively, without stuff like having to construct lists of methods and hooks.package Something::Plugin::Foo; use base qw(Class::AutoPlug::Plugin); sub x:PluggedMethod(methodName) { ...} sub y:Prehook(someBaseMethod) { ... } sub z:Posthook(someBaseMethod) { ... } 1;
|
---|