in reply to how to tell if STDIN is a tty

or the POSIX way:
use POSIX qw/isatty/; something() if !isatty($handle);

AgentM Systems nor Nasca Enterprises nor Bone::Easy nor Macperl is responsible for the comments made by AgentM. Remember, you can build any logical system with NOR.