open2 only captures output from the controlled programs stdout; the error message is being output to its stderr.
Try: my $command = 'plink -ssh -pw password_here username_here@host_name_here -batch exit 2>&1';
In reply to Re: assign open2 output to variable
by BrowserUk
in thread assign open2 output to variable
by adrivez
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |