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] / create.t
1 use Thread;
2 sub start_here {
3     my $i;
4     print "In start_here with args: @_\n";
5     for ($i = 1; $i <= 5; $i++) {
6         print "start_here: $i\n";
7         sleep 1;
8     }
9 }
10
11 print "Starting new thread now\n";
12 $t = new Thread \&start_here, qw(foo bar baz);
13 print "Started thread $t\n";
14 for ($count = 1; $count <= 5; $count++) {
15     print "main: $count\n";
16     sleep 1;
17 }