I have two arrays corresponding to data points on a graph - e.g one array contains the x-values, the other contains the y-values (all are in order so $x_value[0] is paired with $y_value[0] etc). I basically want a quick way of looking up each pair from the two arrays are re-formating them like so: (value_from_y , value_from_x); The problem is that I am working within a foreach loop iterating over 96 lines (and doing this for each line) and it is also within a CGI which chocked after ~ line 22 with my effort below. If anyone knows of a more efficient way to do this I would be very happy.
for (0 .. scalar (@x_values)) { $gradient_array[$_] = '(' . $x_values[$_] . ',' . $y_values[$_] . +')'; }
update (broquaint): fixed formatting
In reply to Pairing values from two arrays by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |