Help for this page

Select Code to Download


  1. or download this
    for my $machine ( @machines ) {
        open my $out, '>', "$machine.dat" or die $!;
    ...
        }
        close $out;
    }
    
  2. or download this
    for my $machine ( @machines ) {
        async {
    ...
            close $out;
        }->detach;
    }
    
  3. or download this
    my $running :shared = 0;             ## This tracks the number of conc
    +urrent threads
    for my $machine ( @machines ) {
    ...
    }
    
    sleep 1 while $running;     ## Make sure the main threads waits for th
    +e last few threads to finish