if ( grep $_ == $xpid, @procs ) { print "Pid is in use : $xpid\n"; } #### $procs = $dbh->selectall_arrayref("select spid from v\$process"); if ( grep $_ == $xpid, @$procs ) { print "Pid is in use : $xpid\n"; } #### $procs = $dbh->selectall_arrayref("select spid from v\$process"); my $found; foreach (@$procs) { if ($_ == $xpid) { $found = 1; last; } } if ($found) { print "Pid is in use : $xpid\n"; } #### $procs = $dbh->selectall_arrayref('select spid from v$process');