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?

Regards,

John Davies

In reply to Tidying up after redirecting STDERR by davies

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.