karthikm897 has asked for the wisdom of the Perl Monks concerning the following question:
I wrote script1.pl which ties STDOUT and STDERR with modifyout.pm and modifyerr.pm respectively. tied print function in modifyout.pm will look like
sub PRINT { my $class = shift; #orig_stdout is file pointer to /dev/stdout return print orig_stdout *some_stdout_wrapper_text* @_; }
All print statements from script1.pl gets this wrapper automatically. But when there is a system command, the output of it doesn't get a wrapper. I tried using other alternatives like IPC::Run3, Capture::Tiny with these I am not getting my requirements fulfilled that XS's(through system command in this case) stdout should be passed through modifyout.pm and stderr through modifyerr.pm and they all should be buffered immediately.
Could someone please help me on this ?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Syncing perltie filehandle STDOUT STDERR and system call
by jandrew (Chaplain) on Dec 14, 2012 at 16:02 UTC | |
by karthikm897 (Initiate) on Dec 17, 2012 at 09:14 UTC | |
by jandrew (Chaplain) on Dec 17, 2012 at 15:49 UTC | |
by karthikm897 (Initiate) on Dec 22, 2012 at 15:50 UTC | |
by jandrew (Chaplain) on Dec 26, 2012 at 18:00 UTC | |
|
Re: Syncing perltie filehandle STDOUT STDERR and system call
by Anonymous Monk on Dec 14, 2012 at 12:19 UTC |