0
我是新来的Perl。 我在perl脚本中执行一组批处理文件。我需要将批处理文件的输出(打印语句和错误)发送到日志文件。相同的日志文件,将有我的perl脚本的输出。 我发现了很多方法将perl脚本的输出放到日志文件中,但是从perl脚本中调用的批处理过程的输出仍然没有进入日志。通过perl脚本执行批处理时,将批处理文件错误和输出到日志文件
我的剧本看起来是这样的:
#!/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";
.
.
在日志的输出看起来像 ABC XYZ
我还需要调用日志