sub foo { my $self = shift; my $object = $self->param("object") or return $self->get_id(); # ... the rest }