sub _get_user_scenario { my ($self, $schema, $user_scenario) = @_; my $user_scenario_rs = undef; 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->{description}, }, { 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 { return $user_scenario_rs; } }