use strict; system("del doesnotexist1"); close(STDERR); open(STDERR,">stderr.out") || die "Could not open STDERR...\n"; system("del doesnotexist2");