Hmm, but it doesn't die when opening the .passwd file? That's weird, time to debug that get_db_login sub line by line right after the open statement. If for some reason you don't get anything from the file then your while loop would never get executed. Btw, you can use $ENV{USER} instead of `whoami`, one less system call :)
I assume it is not dying from
die "$0: Could not find password for $dbUser" unless(defined($dbPass))
+;
since the $dbPass will be defined as an empty string at that point, right?