On Jan 7, 2004, at 12:42 PM, Steve Grazzini wrote:
On Jan 7, 2004, at 2:57 PM, drieux wrote:But simply because there is no controlling terminal does NOT mean that there is nothing on STDIN.
Were you reading that code backwards?
die usage() if @ARGV == 0 and -t;
# if ((THERE ARE NO FILENAMES IN ARGV) && # (STDIN IS HOOKED UP TO A TERMINAL)) # { # COMPLAIN; # }
We only complain if STDIN *is* a tty.
DUH! decaff...
I am probably a little Hyper about STDIN and TTY.
since I was also thinking about moving towards the classic approach of say
foo | bar file1 file2 file3 --stdin
vice the older and uglier
foo | bar file1 file2 file3 -
so that bar could do both - which would have problems if I was going to be dying off in that case - but would of course not be dying off were I spawned in a sub_shell where there was no controlling terminal...
So the problem remains the problem, namely that it is a bit of a cheat to hope that the existence of a terminal line will work as an arbitor of whether or not there is STDIN with bits in it.
ciao drieux
---
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>