if( $ARGV[0] eq 'A' ) { print "I work for a TTY only\n" if -t STDOUT; } if( $ARGV[0] eq 'B' ) { print "I work regardless of TTY-ness of STDOUT\n"; }