JFarr has asked for the wisdom of the Perl Monks concerning the following question:
All mighty monks,
Young prophet beeseaches you wisdom on all PERL :).
I need to write a perl script that is multi-threaded. Not a problem. But withing these threads/subs I need to pull out a $var and a @array.
Everything I have tried seems to fail, including createing a 'my var' at the top of the file. I've even went so far as to try and return a value from the threaded subroutine.
Any help is greatly appreciated.
example:
$thr1 = new Thread \&mysub;
...
sub mysub
{
...
$ddb = someting;# I need this returned to the main
# routine so I can pass it to another
#sub.
...
}
Similar situation for the array.
Thanks in advance.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Retreiving variables from threads
by kwaping (Priest) on Oct 28, 2005 at 22:01 UTC | |
Re: Retreiving variables from threads
by liz (Monsignor) on Oct 28, 2005 at 22:58 UTC | |
by BrowserUk (Patriarch) on Oct 28, 2005 at 23:42 UTC | |
Re: Retreiving variables from threads
by bageler (Hermit) on Oct 28, 2005 at 23:25 UTC | |
Re: Retreiving variables from threads
by zentara (Archbishop) on Oct 29, 2005 at 11:27 UTC | |
Re: Retreiving variables from threads
by JFarr (Sexton) on Oct 31, 2005 at 22:07 UTC |
Back to
Seekers of Perl Wisdom