http://www.perlmonks.org?node_id=998105


in reply to Re^2: Net::SSH::Expect command returns command itself
in thread Net::SSH::Expect command returns command itself

There was no error message. So solution was to add "\r" at the end of command