#!/usr/bin/perl use strict; use warnings; use diagnostics -warntrace; # the -warntrace does not seem to help B-( use DBI; sub db_connect; my $Odbh; # database handle returned by connect to Oracle print "$0: ",(scalar localtime), "\n"; #exit; #no warn if exit before db_connect call &db_connect; exit; # yes warn if exit after connect print "$0: " ,(scalar localtime), " run complete\n"; $Odbh->disconnect; #exit; # yes warn if exit after connect + disconnect ################ sub db_connect { ################ my ($dsn, $dbuser, $dbpassword) = ("DBI:Oracle:qq3","nn2","nn2"); # # Connect to Oracle # # if the push on the next line is commented out there is no warning. push @INC,$ENV{'PERL5LIB'}; # location of libs for DBD::Oracle print "ENV= [",join ("]\n[",@INC),"]\n"; $Odbh = DBI->connect($dsn, $dbuser, $dbpassword, { RaiseError => 1, AutoCommit => 1 }) or warn "Can't connect to $dsn: $DBI::errstr"; }