I use Perl on windows(Active Perl). I have a perl program to glob the files in current folder, and concatenate them all using dos copy command called from within using syste
Issues may arise when you're trying to access the variable $_ inside an inner block. The safest way, change:
foreach (@files)
to:
foreach $file (@files)
Then do the necessary changes on @args, and escape doublequotes to include them in the string..
@args = ('copy' ,"/b ","\"$file\"","+","$outfile", "$outfile");
...
@args = ('copy' ,"/b ","$outfile","+","\"$file\"", "$outfile");