in reply to ssh on windows

Don't do
$ssh->login('$user','$pass');
That will send the literal strings $user and $pass, NOT the value of the variables.

Also, you probably shouldn't put a name and password in your script at all. SSH has much better ways of dealing with authentication.

In any case I expect that that isn't the real code you're actually running, which might or might not make a difference. Can you log in from that machine using another SSH client?

Update: Try removing the "/bin/bash" part, i.e, do:

my($stdout, $stderr, $exit) = $ssh->cmd("/bin/ls -lrt");

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.