in reply to Re^2: Net::SCP::Expect Error Handling
in thread Net::SCP::Expect Error Handling

Under the hood the scp methods in Net::OpenSSH call the scp command.

The option stdout_file indicates a file name where to redirect the output from the command. stderr_to_stdout indicates that stderr should be send to the same place as stdout. That combination is equivalent to the shell >./scp-capture 2>&1.

Replies are listed 'Best First'.
Re^4: Net::SCP::Expect Error Handling
by siddhanta (Initiate) on Jan 29, 2016 at 11:20 UTC

    I have executed the command. and its working fine. It also display the error message. It creates the scp-capture file but does not write anything to it.

      It creates the scp-capture file but does not write anything to it.

      Yes, the scp command doesn't output anything by default unless some error happens. You can set the verbose option in order to change that.

Re^4: Net::SCP::Expect Error Handling
by siddhanta (Initiate) on Jan 29, 2016 at 11:03 UTC

    Look like there is some syntax error with your command. Can you please check.

      yes, the closing parenthesis for the unless condition was missing.