Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
$ENV{MOJO_USERAGENT_DEBUG} =1;
use Mojo::UserAgent;
use Mojo::IOLoop;
my $ua = Mojo::UserAgent->new;
Mojo::IOLoop->delay(
sub {
my $delay = shift;
$ua->get("mojolicious.org" => $delay->begin);
},
sub {
my ($delay, $mojo) = @_;
say $mojo->res->dom->at("title")->text;
}
)->wait;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment