# 1) subclassing package Foo::Bar::Sub; use base 'Foo::Bar'; sub begin_work { shift->try_it } sub commit { shift->do_it } sub begin_work { shift->try_it } # 2) wrapping package Foo::Bar::Wrap; use Attribute::Property; use Scalar::Util qw(blessed) sub new : New; sub object : Property { blessed } sub begin_work { shift->object->try_it } sub commit { shift->object->do_it } sub rollback { shift->object->fallback } # 3) intruding sub Foo::Bar::begin_work { shift->try_it } sub Foo::Bar::commit { shift->do_it } sub Foo::Bar::rollback { shift->fallback }