in reply to Is Process Running In The Background?
There is IO::Interactive that you can use to test if your program is running interactively.