I read in perldoc that the -t file operator is used to determine if a file descriptor is open in tty or not. Then I read what tty is, and from what I understand, is this an old term for a terminal?
My main question, however, is what is this code used for:
if(-t STDERR) {
die "some warning/error message here"
}
I think I don’t quite understand what this means that “the file descriptor opens on tty”. Does this mean that the specific output of this file descriptor appears on tty - or on the terminal? Can tty refer to something other than a terminal?
source
share