This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Initial check-in of Thread module.
[perl5.git] / io.t
1 use Thread;
2
3 sub reader {
4     my $line;
5     while ($line = <STDIN>) {
6         print "reader: $line";
7     }
8     print "End of input in reader\n";
9     return 0;
10 }
11
12 $r = new Thread \&reader;
13 $count = 20;
14 while ($count--) {
15     sleep 1;
16     print "ping $count\n";
17 }
18
19