# with a coderef $pssh->add_host($host, user =>'root', passwd=>'access', on_error=> sub { my ($pssh, $label, $error, $task) = @_; $error == OSSH_JOIN_FAILED and do { ... }; $error == OSSH_ABORTED and do { ... }; $error == OSSH_GOTO_FAILED and do { ... }; }, ); # or with constants $pssh->add_host($label, on_error => OSSH_ON_ERROR_IGNORE); $pssh->add_host($label, on_error => OSSH_ON_ERROR_ABORT_ALL);