Skip to content

Instantly share code, notes, and snippets.

/test.pl Secret

Created December 14, 2017 18:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/b27cb0aef2cbaca25f14d3e1c6bc3989 to your computer and use it in GitHub Desktop.
Save anonymous/b27cb0aef2cbaca25f14d3e1c6bc3989 to your computer and use it in GitHub Desktop.
get('http://mojolicious.org')->then(
sub {
my $mojo = shift;
say $mojo->res->code;
return get('http://metacpan.org');
}
)->then(
sub {
my $cpan = shift;
say $cpan->res->code;
}
)->catch(
sub {
my $err = shift;
warn "Something went wrong: $err";
}
)->wait;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment