|There's more than one way to do things|
Pipe, STDERR, STDOUT, and friendsby devnul (Monk)
|on Sep 21, 2008 at 19:45 UTC||Need Help??|
devnul has asked for the wisdom of the Perl Monks concerning the following question:
I'm really at a loss on the best way to approach this silly problem. I have a command-line program that does not properly generate exit codes (the source code for which is unavailable, so it can't be fixed).
Over the years, I've grown accustomed to using this nomenclature when executing an external command:
(where $filename is usually something grabbed from readdir, so it may contain spaces, etc)..
Unfortunately, the piece of data I need to grab to see if the command has failed is being sent to STDERR, not STDOUT.
For the life of me, I cannot seem to find a way to get the 3+argument version of open to give me what is going to STDOUT.
Alternatively, I am happy to go back to the 2-argument version, but how can I ensure that the filename I am passing in gets through the shell ok?...
...I've been up all night, so I apologize if this seems silly...