in reply to Pairing values from two arrays

What do you want to do with it?
Do you want to simply have "one array"?
How about this then:
@gradient_array= ( \@x_values, \@y_values );
You can access your pair with:
$x=$gradient_array[0]->[$index]; $y=$gradient_array[1]->[$index];
But that's not much better than accessing two arrays, regarding memory.