diff options
Diffstat (limited to 'ext/Thread/io.t')
-rw-r--r-- | ext/Thread/io.t | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/ext/Thread/io.t b/ext/Thread/io.t index 8ade26504d..6012008ef5 100644 --- a/ext/Thread/io.t +++ b/ext/Thread/io.t @@ -1,5 +1,13 @@ use Thread; +sub counter { +$count = 10; +while ($count--) { + sleep 1; + print "ping $count\n"; +} +} + sub reader { my $line; while ($line = <STDIN>) { @@ -17,7 +25,13 @@ finished counting down and the I/O thread has seen end-of-file on the terminal/stdin. EOT -$r = new Thread \&reader; +$r = new Thread \&counter; + +&reader; + +__END__ + + $count = 10; while ($count--) { sleep 1; |