in reply to if database connection failed try to reconnect
Just don't use "or die" in your code. Use something like
my $cnx = DBI->connect();
# try another address
Conway's Game of Life
Perl regular expressions
My Magic 8-Ball™
Results (192 votes). Check out past polls.