in reply to How do I print errors
Might be what you wantsub print_error{ open( OUTFILE, ">> $destination" ) or die "Couldn't open file for +reading.$!\n"; print OUTFILE $_[0]; close OUTFILE } my $dbh = DBI->connect( "dbi:ODBC:RETQC_SQL", "sa", "", {RaiseError => + 1, PrintError => 1, AutoCommit => 0} ) or print_error("Unable to con +nect: $DBI::errstr\n");
|
|---|