# check 'name' entry unless ($name) { $this->stash->{exception} .= "bad name\n"; } # check 'address' entry unless ($address) { $this->stash->{exception} .= "bad address\n"; } # check 'phone' entry unless ($phone) { $this->stash->{exception} .= "bad phone\n"; } return $this->error( $this->stash->{exception} ) if $this->stash->{exception}; ...