unable to capture stderr while performing openssh to a variable- perl
问题 I want to capture the standard error displayed on host machine after (ssh->capture) to a variable. for example when i try: use Net::OpenSSH; my $ssh = Net::OpenSSH->new($host); my $out=$ssh->capture("cd /home/geek"); $ssh->error and die "remote cd command failed: " . $ssh->error; out put is: child exited with code 1 at ./change_dir.pl line 32 i am not able to see what is the error. i get no such file or directory on the terminal. I want to capture the same "no such file or director" in $out.