Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use v5.22;
- use Mojo::UserAgent;
- use Mojo::IOLoop;
- my $ua = Mojo::UserAgent->new->max_redirects(5);
- $ua->get_p('gonna-fail')->then( sub { say 'alive' } )->catch( sub { 5/0; say 'this died' } );
- Mojo::IOLoop->start;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement