use strict; use DBI; use Carp; sub DB_xxx { my ($dbUser, $dbPass, $db, $autoCommit) = @_; my $dbh; # logon to DB unless( $dbh = DBI->connect('dbi:Oracle:' . ($$db || ''), $$dbUser, $$dbPass, {AutoCommit => $$autoCommit}) ) { croak "Error connecting to database $DBI::errstr \n"; } return $dbh; } my $user = "xxxx"; my $pass = "xxxx"; my $db ; my $autocommit = 0; my $dbh = DB_xxx(\$user, \$pass, \$db, \$autocommit); #problem starts here #if we so any unix command call or closing an file/pipe #handle after that such as using system() or backtricks it #returns -1 in $! & $? conatins "no child process" #example `gzip -cd filename`; # or system("gzip -cd filename"); #or open ($fh, "gzip -cd filename|"); #or close ($fh); print "$?:$!\n";