open (my $fh, '>', '1_AppendFile.txt') or die "etc: $!"; @ARGV = glob('*.txt'); while (<>) { print $fh } close ($fh);