in reply to Re: Re: Re: capturing STDERR within a script
in thread capturing STDERR within a script
What I'd rather think is that the way the script is invoked, matters. I usually call scripts from within my text editor, and STDOUT/STDERR are captured by a tool program in order to display the result in an editor window. What's more, I redirect STDERR to STDOUT from withing perl, from withing a little module.
Aha. When I run it from the DOS prompt, without redirection, it works as you said it would. But when I add
to the top of the script, it fails.open STDERR, ">&STDOUT";
The lesson to be learned is that capturing file handles, and maybe STDERR and STDOUT in particular, can be tricky if some redirecting has already been done on the handles before that.
|
|---|