#! /usr/bin/perl -w if(-t STDOUT) { print "We're on a tty!\n"; } else { print "We're not on a tty!\n"; }