in reply to check if databse exists before connection is made!

It seems what you're actually asking about is behaving in different ways based on different servers, rather than checking a database exists: you want one configuration on one server, and a different one on another.

What you could do is check the contents of $ENV{'SERVER_NAME'} , and attempt to connect based on the contents of that. Maybe (it's a bit simple):

my $db; if ($ENV{'SERVER_NAME'} eq '50free.net') { $db = DBI->connect (...); # your public server } else { $db = DBI->connect (...); # your home server } if (! defined $db) { # there was an error }

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.
A reply falls below the community's threshold of quality. You may see it by logging in.