in reply to Re: Net::SSH2 issue in thread
in thread Net::SSH2 issue in thread

According to the libssh2.org site, it is thread safe: "Thread-safe: just don't share handles simultaneously"

I'm not sure if I am sharing handles simultaneously

At the top of my code I call
use Net::SSH2;
Then I create my threads
my $work_q = Thread::Queue->new(); my $thr = threads->new( 'file_worker', $work_q );
In my file_work sub I call the sftp_file if the file is found and supply the required arguments
my $retval = sftp_file($file,$destfile,$host,$port,$user,$privpath,$pu +bpath,$pass);