How do I detect if stdout is connected to a tty in Perl?

Viewed 4657

I'm looking for the Perl equivalent to this Python code:

from sys import stdout
if stdout.isatty():
    print "yes"
else:
    print "no"
2 Answers
Related