in reply to Re: How to approach this i by Perl?
in thread How to approach this i by Perl?
I think I will try to get the threaded program working. I will need some help. Here is relevant sections of the code
use vars qw(%conn $ssh); share(%conn); share($ssh); #code run by thread #Here is where I get the error #Invalid value for shared scalar at $ssh = function(); # in the function sub function { # Create a new pseudo terminal $pty = new IO::Pty $ssh = new Net::Telnet (-fhopen => $pty) return $ssh } # in the Telnet module the code looks like this sub new { my ($class) = @_; $self = $class->SUPER::new; *$self->{net_telnet} = { bin_mode => 0, blksize => &_optimal_blksize(), . . . } $self }
Any idea how I can go about sharing $ssh object created by thread? Is it worth pursuing to use thread to solve this?
Thanks Ashok
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: How to approach this i by Perl?
by suaveant (Parson) on Jan 05, 2010 at 21:18 UTC |