use POSIX qw/isatty/; something() if !isatty($handle); [download]
In reply to Re: how to tell if STDIN is a tty by AgentM in thread how to tell if STDIN is a tty by Anonymous Monk