my $method = $server->can('foo') || $server->can('bar'); $server->$method( @args );