if (timeout_call($workertimeout, sub{ $ssh->system({ timeout => $sshtimeout, stdin_data => "\n", stdout_file => "/tmp/ssh_del_$$.txt" }, $sshcmd."\n"); open FILE, "<", "/tmp/ssh_del_$$.txt"; my @cmdout = ; close(FILE); # my @cmdout = $ssh->capture({timeout => $sshtimeout, stdin_data => "\n"}, $sshcmd."\n"); # if ($ssh->error) # { # $error = $ssh->error; # chomp($error); # print STDOUT "ERROR-2: " . $error . "\n"; # rmtree([ $path ]); # exit 2; # }; push @rawout, @cmdout; }