in reply to Script does not die when DB connection fails

If you set $dbh->{'RaiseError'} to true, then your code will die when either the prepare() or execute() fails.
eval { local $dbh->{'RaiseError'} = 1; my $sth = $dbh->prepare("select task_id, originator_name, creation +_date, due_date, severity from tasks order by task_id"); $sth->execute(); # .. other stuff }; length($@) and dienice("Can't get problem report: $@");