DESCRIPTION

Class::Method::Modifiers::Fast provides three modifiers: before, around, and after. before and after are run just before and after the method they modify, but can not really affect that original method. around is run in place of the original method, with a hook to easily call that original method. See the MODIFIERS section for more details on how the particular modifiers work.

MODIFIERS

before method(s) => sub { ... }

before is called before the method it is modifying. Its return value is totally ignored. It receives the same @_ as the the method it is modifying would have received. You can modify the @_ the original method will receive by changing $_[0] and friends (or by changing anything inside a reference). This is a feature!

after method(s) => sub { ... }

after is called after the method it is modifying. Its return value is totally ignored. It receives the same @_ as the the method it is modifying received, mostly. The original method can modify @_ (such as by changing $_[0] or references) and after will see the modified version. If you don't like this behavior, specify both a before and after, and copy the @_ during before for after to use.

around method(s) => sub { ... }

around is called instead of the method it is modifying. The method you're overriding is passed in as the first argument (called $orig by convention). Watch out for contextual return values of $orig.