in reply to System substitution

When i run your program, i get the following output (on win2k):
$ENV{TYPE}='c:\my test\type me'; $new_debug_log='c:\my test\type me.bat'; $rc = system("\"$ENV{TYPE}\" \"$new_debug_log\""); __output__ @echo off @type %1
That seems right to me, type prints out the contents of the file, and that happens to be the contents of that file. I would probably use the q() command instead of escaping things.
$ENV{TYPE} = q("c:\my test\type me"); $new_debug_log = q("c:\my test\type me.bat"); $rc = system("$ENV{TYPE} $new_debug_log"); __output__ @echo off @type %1
HTH

--
Rock is dead. Long live paper and scissors!