my @names = map { # 1, 3 $i > 6 # 2, 4 ? push(@names,$input2arr[$i]) # 1, 2 : $i++; # 2 } @input2arr;