in reply to Re^2: Control:CLI or Net::SSH2 - Send <ctrl>_
in thread Control:CLI or Net::SSH2 - Send <ctrl>_

> 0x00000: 1f 0a
That's your escape character followed by a newline!

So you aren't sending "Escape-D", but "Escape-Newline-D". You should use ->put instead of ->print for this.

Of course, waiting some seconds, as huck recommends, doesn't hurt, but ->print's trailing output_record_separator would undo the escaping anyway…