Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

How can I tell if STDIN is connected to a terminal?

Replies are listed 'Best First'.
Re: STDIN connectivity
by Anonymous Monk on Mar 05, 2009 at 06:13 UTC

    I think the following code will help you

    if (-t STDIN) { print "stdin is connected"; } else { print "stdin is not connected"; }