in reply to Re^3: STDERR Restore after redirect
in thread STDERR Restore after redirect

print() on closed filehandle $fh # ~~~

But in the code, you just call print! So, $fh has been selected. The solution might be to

select $stdout;
after restoring stdout.

($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,