in reply to perl : $ssh->waitfor

user786:

The Net::SSH::Expect module documentation mentions the before function in the waitfor description. It appears that you can use that function to show what was sent to you. I'd suggest making that part of your error message, so you can see how it differs from what your regex specifies.

...roboticus

When your only tool is a hammer, all problems look like your thumb.