http://www.perlmonks.org?node_id=1011909


in reply to Need to detect continuity between 2 terminals

I'm pretty sure it's possible, though it might not be easy, and it surely depends on the operating system -- which you haven't told us yet.