|I have a perl script that calls in a bat file via the system() command.|
I have set this perl script to run on windows scheduled tasks in a manner that I can capture stderr and stdout to a log file such as:
CMD \C C:\path\to\script.pl >> C:\path\to\log.txt 2>&1
the problem i'm seeing is that when I do it this way, my system() call to execute my batch file fails.
It works perfectly if I run the perl script from the command line, and it also works perfectly if I omit the extra code to capture the stderr and std out in scheduled tasks such as:
I can't for the life of me figure out why it won't work when I try to capture stderr and stdout.
If i comment out the system() call to the batch file it works with the capture of stderr and std out, so it's definately the batch file that is having trouble using this method.
any ideas what I can do to fix this?