$SIG{ALRM} = sub { print "Alarm Captured" ; exit ; } ; alarm 10 ; DBI->connect(...) alarm 0 ;