in reply to DBI connections.


you can use raiseerror
you can use warn if you want to raise a connection alert but do not want to exit.
you can have a "crude implementation" of pinging the server and using a if ( my $output =~ m/ping positive output on your operating system) { query }.
HTH