while (my($key, $hashy) = each %db_process) { # same inner loop # also, since $hashy is anticipated to be a HASH reference, # you can't do $hashy->[0], etc. # you must use $hashy->{key} (with the curly, not square brackets) }