On 6.10.2010 22:46, Jesse Luehrs wrote:
This is what Ricardo said - you want to be doing something like:

For some reason I had it written in my head that there can only be one 'before' and 'after' method. I've actually even skimmed through the MethodModifiers man page before posting and did not notice ...

Thanks and thanks for the patience.

   package TheGreatClass;
   use Moose;

   sub run {
       # do stuff here
   }

   package MyClass;
   use Moose;
   extends 'TheGreatClass';

   before run =>  sub {
       # do_stuff
   };

   before run =>  sub {
       # another_stuff_to_do
   };

   after run =>  sub {
       # cleanup_stuff
   };

-doy

Reply via email to