in reply to Redirecting STDERR to a variable

If I remember correctly, there is information on this in the perldoc pages on the open(). However, this bit of code might help point you in the right direction :-)

open (STDERR, ">>error.log") or die "Cannot redirect STDERR to error.l +og file";
(at least I think that is correct, most of my Perl stuff is at work right now).

Update: Actually, in order to make the most use out of this, you will need to use qx// to run your executable. If you use system() or exec(), you may not always capture all the information you need or want. Thus:

open (STDERR, ">>error.log") or die "Cannot redirect STDERR to error.l +og file"; qx!c:\path\to\executable!; close (STDERR);

Of course, there is probably a better way to do all this that I have not yet discovered :-)


"Ex libris un peut de tout"