运行此程序后
Segmentation fault (core dumped)
以下代码:
use threads;
use Net::SSH::Perl;
my $host = 'hostname';
my $user = 'root';
my $password = 'root123';
my $thread = threads->new (\&ThreadEntry,"ls");
my $thread1 = threads->new (\&ThreadEntry,"ls -al ");
sub ThreadEntry()
{
my $ssh = Net::SSH::Perl->new($host, 35903);
print "in ssh function \n";
my($stdout, $stderr, $exit) =$ssh->cmd(@_);
print "$stdout $stderr $exit\n";
}
$thread->join();
$thread1->join();