in reply to Re^6: Reassign STDOUT/STDERR contents to a variable
in thread Reassign STDOUT/STDERR contents to a variable

Apparently, an internal call to open (by an internal call to require) reused fd 0 (since you closed it), and something is referencing fd 0 rather than *STDIN.
  • Comment on Re^7: Reassign STDOUT/STDERR contents to a variable