in reply to Re^10: Send password in Net::SSH::Expect
in thread Send password in Net::SSH::Expect

Thanks, I found something:
:HOSTA\x{0d}:
Rest seems find. Working on removing this appendix.

Replies are listed 'Best First'.
Re^12: Send password in Net::SSH::Expect
by gafaman (Novice) on Jan 23, 2020 at 11:13 UTC
    Bingo! That was it. Thanks, oh venerable monks! Removed it by adding:
    $hostname =~ s/\r//g;
    Now output shows:
    Launching [[ssh -q user@host 'sed -i "s#.*HOSTA#ssh-rsa AAAAB3NzaC1yc +root@HOSTA#gI" /tmp/test.txt']] at ./key.pl line 81.
    And the command is doing what it should. To learn is to struggle.