Hey all,

I've determined that if I pipe info into a perl script, it's read from the STDIN file handle. Easy enough. No problem there.

I've also determined that if I pipe nothing to this script, it waits for me type something on the keyboard. Again, easy enough.

What I'm trying to do though is to allow the script to read data that's piped in but quit if there is none.

In other words, how do I get this code:

while(<STDIN>)
{
   print $_ . "\n";
}

not to even loop at all if it has to wait for a human being to enter data?

I dealt with this issue in C but it's been some time ago.

Thanks for any help you can offer. I'll gladly clarify if you don't understand.

Keith P. Boruff

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to