in reply to appending to a file
I'd start with error checking. (added: Fletch is more accurate than I am on the functions you'll want to check errors on, consider adding similar error checking to the functions mentioned):
open( my $in, ">>".$seq_dir."/".$fa) or die "Unable to open $seq_dir/$fa for append: $!\n";
Obviously if the file is read only or the path isn't parsed correctly, the open call will fail and you won't be able to write to the file.
In Section
Seekers of Perl Wisdom