in reply to Centralized DSN Switch Script (MySQL)

Print out the filename for debugging purposes. If your webserver is chroot()ed, maybe the filename isn't what you think it is.

I was originally going to suggest making the file into a module proper and writing your own import subroutine. Doing that would allow you to say:

use JDB::DSN 'dev'; my $dbh = connect();
On second thought, that doesn't seem too helpful. If you want to be able to move a development script to a production server without having to edit anything, it won't work. It's a little more robust, though, for values of robust that include packages and avoiding global variables.