# assume %h is your hash, @c and @d are the 'corresponding arrays' @keys=keys %h;@vals=values %h;for($i=0;$i<@keys;$i++){$c[9] = $d[9] = $i if $keys[$i] eq 'something'}