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; }
This method is for connecting to database
Inside my own .pl file I am using this subroutine in following manner:use abc qw (DB_xxx); my $dbh; my $stat1 = system ("gzip -t xyz.gz"); print "The stat checking:$stat1\n"; my $userid = xxx; my $passwd = xxx; my $database = xyz; my $autocommit = 0; $dbh=DB_xxx(\$userid, \$passwd, \$database, \$autocommit); my $stat2 = system ("gzip -t xyz.gz"); print "The stat checking:$stat2\n";
The problem is:the value of $stat1 is 0 but value of $stat2 is -1. though the .gz file is same in same location. In Solaris 8 box but in $stat1 & $stat2 have values 0 for both. But in solaris 10 box giving to two differnt output:$stat1=0 & $stat2=-1
I have also printed $!: For $stat2 it is showing error message: / No child process/
Can anybody please help me? Please it is urgent.
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |