in reply to Re: search an array
in thread search an array
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"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: search an array
by roboticus (Chancellor) on May 26, 2006 at 11:45 UTC | |
|
Re^3: search an array
by Anonymous Monk on May 26, 2006 at 13:55 UTC |