in reply to Problem logging STDOUT in perl

Perhaps you need to close STDOUT before opening? You can also use Capture::Tiny and/or IO::Tee instead of running tee.
Sorry if my advice was wrong.