Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Perl Misc (http://www.velocityreviews.com/forums/f67-perl-misc.html)
-   -   capturing stdout and stderr? (http://www.velocityreviews.com/forums/t911192-capturing-stdout-and-stderr.html)

Mike 08-09-2009 09:33 PM

capturing stdout and stderr?
 
Morning,

I'm asking where do I start my research, recommendations for a module
or function. I'm not asking for code that does what I need.

I have a need to start a command then read the command's stdout and
stderr streams, capturing each line individually, prepending 'STDOUT:'
or 'STDERR:' to the line depending on which stream the line came from,
then writing the line to a central log file.

In C I would fork(), exec(), then from the parent just use select()
to grab each line that comes from the child.

Is the same approach the simpleist way in Perl or should I look at
IPC::Open3 or IPC::Run?

This script needs to run on linux, HP-UX, Solaris, IRIX, Mac OS X,
cygwin/win32, and cygwin/win64.

Thanks for your thoughts.

Mike


All times are GMT. The time now is 04:45 PM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57