Another way to do it:my $xpid = 1234; %procs = map { $_ => 1 } @{ $dbh->selectall_arrayref( "select spid fro +m v\$process" ) }; if ( $procs{ $xpid } ) { print "Pid is in use : $xpid\n"; }
my $xpid = 1234; @procs{ @{ $dbh->selectall_arrayref( "select spid from v\$process" ) } + } = (); if ( exists $procs{ $xpid } ) { print "Pid is in use : $xpid\n"; }
In reply to Re^2: search an array
by jwkrahn
in thread search an array
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |