For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > August 2005 > How to redirect STDERR to STDOUT within an open?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author How to redirect STDERR to STDOUT within an open?
goofire@gmail.com

2005-08-06, 4:59 pm


Hi,

I want to perform the equivalent in Perl to "./foo 2>&1" in the shell.

In other words, open an external program for reading, but include
STDERR in STDOUT, so to speak.

I've tried the following, but it doesn't work:

open(PROGRAM, "program 2>&1 |") or die "$!";

Any ideas?

- gf

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com