Disconnects the database handle from the database it is connected to. With MySQL, a call to disconnect is not needed because transactions are not currently supported. However, if transactions do become supported, then you’ll need to call $database->disconnect before you exit the program, to make sure ensure all the changes have been committed to the database.
A call to disconnect before ending a program is a good idea if you want to create portable code. If there is an error disconnecting from the database, the error message gets stored in $DBI::errstr.
$db_handle->disconnect or die ("Error: $DBI::errstr\n");