in reply to why single channel is not supporting multiple cmds in NET::SSH::PERL

You need to capture the STDOUT, STDERR and return values of $ssh->cmd, so that you can see what is going wrong. Something like:
my ($out, $err, $exit) = $ssh->cmd("....");

If you then examine the value of $err, you'll almost certainly see that you've tried to cd to a non-existent directory.

And the reason why you see the contents of your home directory when you issue the second command is because the first failed.

Exactly what is it that you are trying to do?

  • Comment on Re: why single channel is not supporting multiple cmds in NET::SSH::PERL
  • Download Code