Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!cs.utexas.edu!romp!auschs!awdprime!hotwheel.austin.ibm.com!root From: root@hotwheel.austin.ibm.com (/50000) Newsgroups: comp.lang.perl Subject: re(REDIRECTION) Message-ID: <8382@awdprime.UUCP> Date: 11 Jun 91 21:50:45 GMT Sender: news@awdprime.UUCP Organization: IBM AWD, Austin Lines: 18 Originator: root@hotwheel.austin.ibm.com >Hi guys, > I have a question with respect to redirection. > > Is there a way to know whether the standard output has been redirectedinside a perl script. > >eg : perl.script > perl.script.out > >here as you see the standard output is being redirected to perl.script.out I just found out that there is a C library routine - isatty to know whether the STDOUT has been redirected to a file. So I guess I have to write a small C function to use it in my perl script. If you guys out there have any other ideas, I really would appreciate it.  Thanks a lot. DISCLAIMER: my opinions are independent of IBM's position.