unless ($result) {
- my $comp;
+ my $class = ref($command) || ref($c->component($command));
+ my $method = shift || 'process';
- unless ( $comp = (ref $command ? $command : $c->component($command)) ) {
+ unless ( $class ) {
my $error =
qq/Couldn't forward to command "$command". Invalid action or component./;
$c->error($error);
return 0;
}
- my $class = ref $comp;
- my $method = shift || 'process';
-
if ( my $code = $class->can($method) ) {
my $action = $self->method_action_class->new(
{
# should catch any failures - or short-circuit this if this *is* a
# bug in the visitor and gets fixed.
- my $extra = $path[ ( scalar @match ) - 1 ];
- last unless $extra;
- $visitor->setSearchPath($extra);
- $match[-1]->accept($visitor);
- push( @match, $visitor->getResult ) if defined $visitor->getResult;
+ if (my $extra = $path[ ( scalar @match ) - 1 ]) {
+ $visitor->setSearchPath($extra);
+ $match[-1]->accept($visitor);
+ push( @match, $visitor->getResult ) if defined $visitor->getResult;
+ }
}
return map { $_->getNodeValue } @match;