In my man page, it explains that (summarized):
open $oldout, ">&STDOUT" #opens STDOUT in $oldout variable
open STDOUT, '>', "foo.out" #redirects STDOUT to "foo.out" (write mode)
open STDOUT, ">&", $oldout #redirect STDOUT once more, this time to $oldout, where the original stdout was
#stored in. So this should effectively restore the normal STDOUT.
Have you tried that?
And added some prints to test if all is well?