in reply to Re: Windows XP: Perl Command Line Interpreter Encountered an Error
in thread Windows XP: Perl Command Line Interpreter Encountered an Error
instead of thismy @threads; for my $i (0..19) { print "THREAD SPAWNED.\n"; $threads[$i] = threads->new(\&mainsub, $i); $threads[$i]->detach; sleep 1; }
'red flag' code repetition.print "THREAD SPAWNED.\n"; $thr1 = threads->new(\&mainsub,0); $thr1->detach; sleep 1; print "THREAD SPAWNED.\n"; $thr2 = threads->new(\&mainsub,1); $thr2->detach; sleep 1; # ...
-- Hofmator
|
|---|