I have two arrays @input0 and @input1. I would like a for loop that goes through every value in @input1 and if the value exists in @input0, the value is saved in a new array @input.
All arrays contain numbers only. There are a maximum of 10 numbers per array element (see below):
@input0 = {10061 10552 10553 10554 10555 10556 10557 10558 10559 10560, 10561 10562 10563 10564 10565 10566 10567 10573 10574 10575, ...}
@input1 = {20004 20182 ...}
@input0 = {10061 10552 ...., 10561...}is not valid perl syntax, and would give errors such asNumber found where operator expected. You'd need to quote the strings"10061 10552 ...". Also, the curly brackets{}create a hash reference. You want regular parens()when assigning to an array.