in reply to Parsing Text from Object Header that prints to STDOUT

redirecting STDOUT to scalar doesn't work (the OP just toll me). I think it's because the output is generated from a C function that writes to stdout.

When STDOUT is redirected in a perl script, the perl interpreter changes C/Unix stdout accordingly, but a scalar has no associated file descriptor so in that case, stdout just remains unchanged.

On the other hand, redirecting STDOUT to a real file should work!

  • Comment on Why redirecting to scalar doesn't work (Re: Parsing Text from Object Header that prints to STDOUT)