robblin has asked for the wisdom of the Perl Monks concerning the following question:
sub doSomethingStupid { $ENV{TIME} = shift; sleep($ENV{TIME}); print "Time is $ENV{TIME}"; } @vars = ("1", "2", "3", "1"); foreach $var (@vars) { my $thread = new Thread \&doSomethingStupid ($var); $thread->detach(); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: $ENV for Threads?
by Dog and Pony (Priest) on Apr 09, 2002 at 09:51 UTC | |
|
Re: $ENV for Threads?
by perlplexer (Hermit) on Apr 09, 2002 at 13:14 UTC | |
by Elian (Parson) on Apr 09, 2002 at 17:31 UTC |