Net::SSH and STDIN / Pending jobs


I am writing a library that allows the user to run some commands over
SSH into a server and I have two problems right now:

  1. The code get stuck whenever the executed code needs STDIN, it just
    sits there. How can I indicate that my STDIN is not interactive using

  2. When the user runs background jobs (like nohup
    /etc/init.d/start-something &) the script just sits there as well,
    waiting for jobs to finish.

Considering the script that is executed is a user input and, being so, I
don’t have control over it, what would be the best way to avoid those 2

Thanks a lot!

Best regards,