Advertisement
Guest User

Untitled

a guest
Aug 7th, 2019
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. use v6;
  2.  
  3. my @checks = (
  4. [ 'perlmonks.com',80 ],
  5. [ 'perlmonks.org',80 ],
  6. [ 'perlmonks.org',25],
  7. [ 'fail.com',25],
  8. );
  9.  
  10. my @promises = @checks.map( -> @check { IO::Socket::Async.connect( @check[0], @check[1] ) } );
  11. my @answers = await @promises;
  12.  
  13. -------------------------------------
  14.  
  15. D:\ENV>perl6 pcheck.pl
  16. An operation first awaited:
  17. in block <unit> at pcheck.pl line 11
  18.  
  19. Died with the exception:
  20. connection timed out
  21. in block <unit> at pcheck.pl line 11
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement