in reply to $1 into an array

Three things:

  1. You assign your $1 into a hash but print from an array. As others have said, it's best to assign into an array, using push().
  2. You create a variable, %slotarray, whose scope terminates with the end of the if block. Therefore, the variable is undefined when you go to print. You need to declare the variable at a scope visible to all uses of the variable, in this case, globally. Others have corrected your error, but not explained it.
  3. You don't do actually anything with the saved data.

    Instead of saving $1 into an array, you might as well print it when you find it. But assuming you did plan to do something more sophisticated, such as sorting the elements, you don't need to print the array using a loop ... that's such a C thing to do. Perl is efficient when you deal with sets of data all-at-once, letting Perl do the iterating.

    You might use join():

    print OUTFILE join( "\n", @slotarray ), "\n";

    Alternately, you could locally redefine the $LIST_SEPARATOR, $" :

    { local $" = "\n"; print OUTFILE "@slotarray\n"; }

--
TTTATCGGTCGTTATATAGATGTTTGCA