You can read from STDERR. It's just as easy as <STDERR>.

Correction:

If you are not redirecting, then STDIN, STDOUT and STDERR are really all references to the same thing, your terminal. You can see this by running (at least on linux):

ls -l /proc/self/fd/
as well as variations on the theme, like:
ls -l /proc/self/fd/ < /dev/null ls -l /proc/self/fd/ | cat ls -l /proc/self/fd/ 2> /dev/null #redrect STDERR
0 = STDIN, 1 = STDOUT, and 2 = STDERR.

If you want to be clever, then you can try to detect which of STDIN, STDOUT and STDERR are actually terminals, by using the -t operator. Also, you could just reach around the standard IO channels and open a direct shot to the controlling tty of the process like:

open TTY, ">/dev/tty" or die "Couldn't open /dev/tty $!";

------------
:Wq
Not an editor command: Wq

In reply to Re: STDIN schizofrenia by etcshadow
in thread STDIN schizofrenia by Anonymous Monk

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.