Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/env perl
    
    use strict;
    use warnings;
    use threads;
    
  2. or download this
    while (<DATA>) {
        threads->create(sub { print 'Thread ', threads->tid, ': ', $_ })->
    +join;
    }
    
  3. or download this
    __DATA__
    list.txt line 1
    list.txt line 2
    list.txt line 3
    
  4. or download this
    Thread 1: list.txt line 1
    Thread 2: list.txt line 2
    Thread 3: list.txt line 3