I am new to perl. I am executing a set of batch files in a perl script. I need to send the output(print statements and errors) of the batch file to a log file. The same log file that will have the output of my perl script. I have found many ways to put the output of the perl script to a log file but the output of the batch process that is called from the perl script is still not going to the logs.
My script looks something like this:
#!/usr/bin/perl
use strict;
use warnings;
use File::Path;
use File::Copy;
.
.
Print "abc";
.
my @args= ('C:\SBS\Install\UpgradeSBSDB_Oracle.bat');
open (FHU,"|@args") or die "Fail to open Upgrade.batch file: $!";
print FHU "\n";
.
.
Print " xyz";
.
.
The output in log looks like abc xyz
I also need the output of the batch file called in the logs