in reply to Piping input as an option

You could test whether STDIN is attached to a terminal:
$ perl -le 'print "yes" if -t STDIN' yes $ perl -le 'print "yes" if -t STDIN' < /dev/null $

Dave.

Replies are listed 'Best First'.
Re^2: Piping input as an option
by jkelly (Initiate) on Jul 04, 2007 at 13:04 UTC
    perl -le 'print "yes" if -t STDIN'

    Perfect! Thanks, Dave, this is exactly what I was looking for.

    Thank you to all three of you for your suggestions. I'm set now.

    -jkelly