my $error = $s->error if ($count > 0); ## log this action &log_action('error') if ($count > 0);