tadeufae has asked for the wisdom of the Perl Monks concerning the following question:
use threads; use strict; my $returnn = ""; threads->new(sub { sleep(3); print "Run the thread! Variable should be set\n"; $returnn = "bla ble bli"; }); while (1 == 1) { if ($returnn ne "") { print "It works!\n"; } else { print "Doesn't work at all... :(\n"; } sleep(1); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How do I get a result from a thread?
by rafl (Friar) on Mar 20, 2006 at 15:15 UTC | |
|
Re: How do I get a result from a thread?
by zentara (Cardinal) on Mar 20, 2006 at 16:32 UTC | |
by tadeufae (Initiate) on Mar 20, 2006 at 17:09 UTC | |
|
Re: How do I get a result from a thread?
by McDarren (Abbot) on Mar 20, 2006 at 15:23 UTC |