in reply to Two ODBC Connections

Whenever you feel the need to cut and paste a block of code, it's generally a better idea to turn that block of code into a subroutine.

Further, when reporting an error, it's good to report as much relevant information as possible. Rather than saying

die "Could not open connection to DSN because of [$!]";
you'd be able to say
die "Could not open connection to $DSN_parameter because of [$!]";