Hi,
Can anyone explain me why the inner-pre-hook loop of the subroutineGT::Plugins::dispatch_method (line 157 in version 1.43) looks like this:
$self->debug ("Plugin: pre $hook_name running => $hook")
if ($self->{_debug});
defined &{$hook} or $self->_load_hook ($hook, 'PRE') or next;
$ACTION = CONTINUE;
@results = $hook->($object, @args);
$ACTION == STOP and last;
}
unless ($ACTION == STOP) {
@results = $object->$method(@args);
}
and not like this
$self->debug ("Plugin: pre $hook_name running => $hook")
if ($self->{_debug});
defined &{$hook} or $self->_load_hook ($hook, 'PRE') or next;
$ACTION = CONTINUE;
@args = $hook->($object, @args);
$ACTION == STOP and last;
}
if ($ACTION == STOP) {
@results = @args;
} else {
@results = $object->$method(@args);
}
Thanks, Jasper
http://www.bookings.org
Can anyone explain me why the inner-pre-hook loop of the subroutineGT::Plugins::dispatch_method (line 157 in version 1.43) looks like this:
Code:
if (exists $PLUGIN_CFG->{_pre_hooks}->{$hook_name}) { $self->debug ("Plugin: pre $hook_name running => $hook")
if ($self->{_debug});
defined &{$hook} or $self->_load_hook ($hook, 'PRE') or next;
$ACTION = CONTINUE;
@results = $hook->($object, @args);
$ACTION == STOP and last;
}
unless ($ACTION == STOP) {
@results = $object->$method(@args);
}
Code:
if (exists $PLUGIN_CFG->{_pre_hooks}->{$hook_name}) { $self->debug ("Plugin: pre $hook_name running => $hook")
if ($self->{_debug});
defined &{$hook} or $self->_load_hook ($hook, 'PRE') or next;
$ACTION = CONTINUE;
@args = $hook->($object, @args);
$ACTION == STOP and last;
}
if ($ACTION == STOP) {
@results = @args;
} else {
@results = $object->$method(@args);
}
Thanks, Jasper
http://www.bookings.org