@arg{key} = (1 .. 6); foreach my $physh (@{$arg{key}}){ next if (!$hash{$_}[2]{$physh}[9]); ... }