Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. use v5.22;
  2. use Mojo::UserAgent;
  3. use Mojo::IOLoop;
  4.  
  5. my $ua = Mojo::UserAgent->new->max_redirects(5);
  6.  
  7. $ua->get_p('gonna-fail')->then( sub { say 'alive' } )->catch( sub { 5/0; say 'this died' } );
  8.  
  9. Mojo::IOLoop->start;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement