So: reverse the hash and array in your test. Loop through the array, and let perl look it up in the hash for you.
for my $i (0 .. $#all_ids) { my $key = $all_ids[$i]; if(exists $hash{$key}) { print "$key => $hash{$key} => $all_gc3s[$i]\n"; } else { print "Item '$key' is not in the hash.\n"; } }
There. Probably lots faster.
In reply to Re: stuck in a hash
by bart
in thread stuck in a hash
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |