use strict; use warnings; use File::Glob qw{bsd_glob}; my $string; my $entry; do { print"\n\n Press 1 to Enter New File or 2 to Combine: "; $entry=; chomp $entry; if ($entry==1) { print"\n\n Enter New File Name (.txt): "; my $filename = ; chomp $filename; open my $fh, "<", $filename or die "Cannot open $filename.\n"; my $DNA; { local $/=undef; $DNA = <$fh>; } close $fh; chomp $DNA; $DNA=~s/\n/,/g; $string .= "{$DNA}"; } # Curly brace for entry1 ends: } until ($entry==2); for (bsd_glob $string) { print "~$_~\n"; }