I’m looking for the Perl equivalent to this Python code:
from sys import stdout
if stdout.isatty():
print "yes"
else:
print "no"
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use the -t filetest operator.
Note that in Perl, STDOUT can be tied (essentially an overcomplicated overloaded object) so output to STDOUT may still reach a TTY even if its not directly attached to one.