in reply to How to pass variable to Net::OpenSSH method

How does it fail to work?

Net::OpenSSH has a debugging mode that you can enable adding the following line at the beginning of your script:

$Net::OpenSSH::debug = -1;