실행하고 외부 명령, 어떤 도움이 apreciated되는 로그 파일 및 트랩 출구 상태펄 -
my $cmd = "db2 \"insert into schema.tablea (id, name, city) values (99, 'Micheal', 'London')\" ";
open my $log, ">", "logfile.log";
my $rt = open(OUTPUT,"$cmd 2>&1 | ");
while (<OUTPUT>){
chomp;
print $log $_, "\n";
print $_, "\n";
}
close(OUTPUT);
close($log);
print "Exit status is $rt\n";
에 출력을 쓸 필요가 외부 명령에 대한 트랩 종료 상태 캡처 로그에 가장 좋은 방법.
당신은 당신이 DBI와 DBD :: DB2를 사용하지 않는 이유 IPC :: 실행 또는 IPC :: 특히 된 Open3 – kjprice
어떤 이유에서 살펴 봐야 할 것인가? –