|P is for Practical|
Tidying up after redirecting STDERRby davies (Prior)
|on Feb 22, 2010 at 20:33 UTC||Need Help??|
davies has asked for the wisdom of the Perl Monks concerning the following question:
I have written some Perl that generates POD and then uses pod2html to convert it. This outputs text that I wish to capture to a text file. pod2html writes to STDERR, and Losedows's redirection fails to pick it up.
Googling gave me http://www.perturb.org/display/entry/883/ with methods of redirecting STDERR. The first failed, but the second, *STDERR = *STDOUT, works perfectly. So my code works. This comes right at the end of my code, so perhaps I shouldn't care about anything else.
But mummy always told me to tidy up after myself (I never do in real life). I don't know if I am building traps for myself by failing to reset STDERR to its normal destination, and advice on that would be appreciated. Since I can't easily tell the two apart from the command prompt, I don't really how to be sure if anything I put in has worked. Nor has my googling given any clues. So, my friends, please could you tell me:
Will Perl reset STDERR automatically, and if so, when?
How do I reset it explicitly?