Commit | Line | Data |
---|---|---|
d9bb3666 | 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 | } |