in reply to stuck in a hash

You're not using the hash as it is intended. Instead, you're emulating a hash using a normal array... and you're looping though the hash like it was an array.

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.