Help for this page

Select Code to Download


  1. or download this
    local *STDOUT;
    local *STDERR;
    
  2. or download this
    my $thread1 = threads->create ( \&worker, 1, 'sub1.log' ); 
    my $thread2 = threads->create ( \&worker, 2, 'sub2.log' ); 
    
    ...
    $thread2->join();
    
    exit 0;
    
  3. or download this
    my @threads = map {threads->new(\&worker, $_, "sub$_.log")} 1..2;
    $_->join for @threads;
    
    exit 0;