in reply to Re^2: Problem With Net::SSH::Expect using Multi threads
in thread Problem With Net::SSH::Expect using Multi threads

According to http://search.cpan.org/~rgiersig/Expect-1.21/Expect.pod#Is_it_possible_to_use_threads_with_Expect?

you should construct each Expect object in the main thread and then spawn the subthread to handle it.

I've no idea if that will actually work, but it's worth a try.

In general, it's not a great idea to force perl threads on a problem unless you either know that it'll work, or you've got a very good reason to prefer threads over fork() AND you've got the time to fix various bugs like this (and worse).

  • Comment on Re^3: Problem With Net::SSH::Expect using Multi threads