sub _get_user_scenario { my ($self, $schema, $user_scenario) = @_; my $user_scenario_rs = undef; my $user_scenario_desc; # In the case where the description is not Null if($user_scenario->{description}){ $user_scenario_desc= $user_scenario->{description}; }else{ Line #799 ===> $user_scenario_desc = $schema->resultset("UserScenario")->search({ "name" =>$user_scenario->{name}, })->first->description; } eval{ #get the number of user scenarios in the database table my $count = $schema->resultset("UserScenario")->count(); #insert user scenario, or if already in database, update the description $user_scenario_rs = $schema->resultset("UserScenario")->update_or_create( { name => $user_scenario->{name}, description => $user_scenario_desc, }, { key => "u_user_scenario_name" }, ) || die "Unable to update/insert data to table UserScenario: $!\n"; }; if($@){ #warn(); $self->log_writer()->write_error_row("Unable to get/insert data to table UserScenario: $@"); return undef; }else{ $self->log_writer()->write_row("Inserted values into user_scenario table"); print"Inserted values into user_scenario table\n"; return $user_scenario_rs; } }