in reply to More than one way to do it???

This is a duplicate of the Q&A item More than one way to do it???. My response (Re: More than one way to do it???) was this:

You can use the ttyname() function in POSIX to get this:

use POSIX 'ttyname'; $tty = ttyname(0);