in reply to Re^4: How to close command prompts opened with perl script after execution that scriptin thread How to close command prompts opened with perl script after execution that script
See tee and/or File::Tee.