Mailing List Archive

warning needed
If this works this way:

% perl -we 'print STDIN "test"'
Filehandle main::STDIN opened only for input at -e line 1.

Then this shouldn't be silent:

% perl -we 'print <STDOUT>'

--tom

Tom Christiansen Perl Consultant, Gamer, Hiker tchrist@mox.perl.com
Sorry. My testing organization is either too small, or too large, depending
on how you look at it. :-)
--Larry Wall in <1991Apr22.175438.8564@jpl-devvax.jpl.nasa.gov>
Re: warning needed [ In reply to ]
In article <7780.819033171@mox>, Tom Christiansen (tchrist@mox.perl.com) wrote:
> If this works this way:

> % perl -we 'print STDIN "test"'
> Filehandle main::STDIN opened only for input at -e line 1.

> Then this shouldn't be silent:


Why?

If it were

% perl -we '$input = <STDOUT>'

I'd understand.

Yours,
--
Steffen Beyer
mailto:sb@sdm.de |s |d &|m | software design & management GmbH&Co.KG
phone: +49 89 63812-244 | | | | Thomas-Dehler-Str. 27
fax: +49 89 63812-150 | | | | 81737 Munich, Germany.
Re: warning needed [ In reply to ]
>> Then this shouldn't be silent:
>> % perl -we 'print <STDOUT>'

>Why?

>If it were

> % perl -we '$input = <STDOUT>'

>I'd understand.

Because <STDOUT> is not the \*STDOUT filehandle. It is
instead a getline operation out of that filehandle!!
Imagine this

print STDOUT ( STDOUT->getlines() );

that's what's going on. Do you actually think it makes
sense to read from stdout, then send stuff back down it?

--tom