I have some select result from database(like on image).

I need do foreach cycle for id
It's must looks like this
foreach () {
if ($status==1) {
if ($process_id ~~ @some_array) {
#do something
}
}
How do for each cycle? As I understand I need to get a result from a base in hash form $ref = $sth->fetchrow_hashref, but I never worked with him, and my attempts were unsuccessful. Help me please.
$sth->fetchrowtype methods can be called in awhileloop to fetch and process one at a time943 1 0 0But it's not true for me. Code likewhile($ref = $sth->fetchrow_hashref) { @keys = keys %$ref; @values = values %$ref; }does not fit too~~ @arraybecause it's faster and because it won't change on you.my %some_array = map { $_ => 1 } @some_array;, thenif ($some_array{$process_id}) { ... }