in reply to printing to a scalar -- STDIN, STDOUT, STDERR
I want to have any data that would go to STDOUT, STDERR, STDIN to go to a variable.
The short answer: forget it, it doesn't work.
Reason is that when you open a hande to a scalar, you'll get a perl-internal file handle with no associated system file descriptor (fileno() would give -1). And only those file descriptors can be inherited/shared across the fork/exec which is being done behind the system() call. The child process doesn't have access to perl-internal file handles.
|
|---|