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); }
In reply to How do I get a result from a thread? by tadeufae
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |