Help for this page
How do I find out if I'm running interactively or not? Good question. Sometimes -t STDIN and -t STDOUT can give clues, someti +mes not. ... } else { print "background\n"; }
$on_a_tty = -t STDIN && -t STDOUT; sub prompt { print "yes? " if $on_a_tty } for ( prompt(); <STDIN>; prompt() ) { # do something }