Are you executing a $dhh->disconnect after you're done with using the db?
I would suggest running your script using the debugger to find out where it is hanging up.
from the command line:
perl -wd script_name.cgi
If you have query string parameters you can send them in as command line args:
perl -wd script_name.cgi name=value name2=value
The n key will step thru your program line by line, s will step into a subroutine. You should easily be able to find the line causing the problem that way. Check the docs for the debugger, it's the way to go.
Yes, I'm using $dbh->disconnect, which is returning 1. I've tried running the script from the server and it executes fine and the process terminates like it should. It's only giving me a problem when IIS is running the process. Does anyone have any idea what this might be?