Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use v6;
- my @checks = (
- [ 'perlmonks.com',80 ],
- [ 'perlmonks.org',80 ],
- [ 'perlmonks.org',25],
- [ 'fail.com',25],
- );
- my @promises = @checks.map( -> @check { IO::Socket::Async.connect( @check[0], @check[1] ) } );
- my @answers = await @promises;
- -------------------------------------
- D:\ENV>perl6 pcheck.pl
- An operation first awaited:
- in block <unit> at pcheck.pl line 11
- Died with the exception:
- connection timed out
- in block <unit> at pcheck.pl line 11
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement