I have an array of values which I'd like to transform using another array, like so
@raw_values = qw(10 20 30 40);
@adjustment_factors = qw(1 2 3 4);
#the expected value array
@expected_values = qw(10 40 90 160);
Is there a more perlish way to doing that then this?
for my $n (0..$#raw_values){
$expected_values[ $n ] = $raw_values[ $n ] * $adjustment_factors[ $n ]
}
The arrays always have the same number of elements, and I have a few thousand to process.