I have a script that seems to fail when it is scheduled. I am trying to put some error handling in. I would like to start with the connection to the database. This is my connection string.
my $dbh = DBI->connect( "dbi:ODBC:RETQC_SQL", "sa", "",
{RaiseError => 1, PrintError => 1, AutoCommit => 0} ) or
die "Unable to connect: $DBI::errstr\n";
What I would like to do is write the error message to a file that I have opened.
open( OUTFILE, ">> $destination" ) or die "Couldn't open file for rea
+ding.$!\n";
Edit by thelenm: fixed code tags