in reply to get the errors only for a part of the program

Works OK for me. I tried:
use warnings; use strict; BEGIN { open(STDERR, ">stderr2.log") or die "Failed to open log file"; } print STDERR "Oops!\n"; system ('nosuchprogram'); close STDERR;
In stderr2.log was:
Oops! 'nosuchprogram' is not recognized as an internal or external command, operable program or batch file.
Running on 5.10.0 Windows.

update: I guessed that "subscript" meant another script being called as a child process, but could be wrong.