in reply to elements of an array

Is it possible that what you mean is that you would like to subtract $State[i] from $Product[n], for each element of @State? There is more than one way to do that, but here is one way using map that I happen to like:

my @array = map { $Product[$_] - $State[$_] } 0..$#State;

Of course I could be misinterpreting your question entirely. Others have assumed that you mean you want to join all elements together. For that, you use join. But if your intention is to subtract each element of @State from the element of the same index number from @Product, this is how it's done. I only mention it because I see that minus sign in your example.


Dave


"If I had my life to live over again, I'd be a plumber." -- Albert Einstein