while (($key2, $value2) = each (%gradient_hash)) { if (($value2 > 0.1) || ($value2 < -0.1)) { push @steep_grads, $key2 . '?' . $value2; push @slopes, $value2; } }