DavidSzczesniak
12/21/2017 - 1:12 PM

Method Modifiers

A hook that is called when a named method is called. For example, "before calling login(), call this modifier first. They come in different types like 'before', 'after', 'augment'. More than one can be applied to a single method.

before 'login' => sub { # do this before calling login()
  my $self = shift;
  my $pw = shift;
  
  warn "Called login() with $pw\n";
};