#Print the file print $_.$/ for (@fastafile); #Reverse the file @fastafile = reverse @fastafile; #Change the 2nd secuence $fastafile[1] = $other_seq; #Put more sequences push @fastafile, $other_seq;