On Jan 7, 2004, at 1:10 PM, drieux wrote:
On Jan 6, 2004, at 12:53 PM, Steve Grazzini wrote:
die usage() if @ARGV == 0 and -t;

You might not want to test if there is a controlling terminal

I want to test whether STDIN (the default argument for -t) is hooked up to the terminal (which is what -t tells you) so that <ARGV> doesn't block waiting for user input.

But if you want to quibble, this still blocks:

% perl -pe 'BEGIN{ die if @ARGV == 0 and -t }' /dev/tty

--
Steve


-- 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