Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- use 5.010;
- use strict;
- use warnings;
- use Coro;
- my $res = Coro::Channel->new;
- my @nums = qw(1 32 2 59 2 39 43 15 8 9 12 9 11);
- for my $n (@nums){
- async {
- Coro::cede for 1..$n;
- $res->put($n);
- }
- }
- say $res->get for 1..@nums;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement