On Mon, 2 Sep 2002 20:32:28 +0530 , Agarwal, Ramakant wrote: > I want that if someone kills the process while the script is in >execution then it should log off from the database and then should exit. >Does the log off from the db happen automatically whenever a process is >killed or we do need to explicitly handle this?
I suspect the latter. You can do that by doing END { $dbh->disconnect if $dbh; } where $dbh is the DBI database handle. A code block like this will always be executed at the end of the program run, even if it happens by a gentle signal, the equivalent of ctrl-C. -- Bart.