my file_end = '.fasta'; ... open my $fh, '>>', "$ko$file_end" or die "Cannot open '$ko$file_end' because: $!";