I've got a question about writing perl scripts which die 'properly' when killed.
Basically I've got some scripts that access MySQL databases and I've noticed that when I 'Ctrl^C' them or 'kill -9' them, the connection to the MySQL database hangs around for a while. Is there a way of writing a script so that when it is killed prematurely, it will close of the connection to the database quicker?
I use $dbh->disconnect, but of course this only works if the script gets to execute it...