How can I connect to multiple databases in perl without it bailing out if it can’t connect to one? If I have the database names in an array and go trough them in a loop, I want to try and connect and perform a query and disconnect. I am going to report it back to the big brother server monitoring page we have. I don’t want the script to terminate if it can’t connect to one, since it obviously needs to check every one in the array. Right now i use the DBI modules state method but I don’t know that it works correctly. Thanks for everyone’s time!
Share
Can we see the code? I don’t think a call to
DBI->connect()will die unless you explicitly tell it to, as in:I’m pretty sure even using {RaiseError => 1} won’t make it die automatically. So, if you are calling
or die...just don’t do it!EDIT:
Given the code that @squiguy posted, I would do it like this: