you are assigning a reference to an anonymous slice. If you really want to stuff the 1..21 elements of the @array into the scalar $MAIN[$seq_unique][$seq_position] then the RHS should be join / / @array[1..21]; Not sure exactly what you're trying to do..please explain.