This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my $ua = Mojo::UserAgent->new(); | |
my $result; | |
$self->render_later; | |
$ua->head( $location => sub { | |
my ($ua, $tx) = @_; | |
if ( $tx->res->code eq '200' ) { | |
$result = 'good'; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my $t = Test::Mojo->new; | |
sub f2 { | |
my $cb = shift; | |
my $d = Mojo::IOLoop->delay( | |
sub { | |
warn 'f2_1', $/; | |
shift->pass; | |
}, | |
sub { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl -wl | |
# code for answer on question | |
use Mojo::IOLoop; | |
sub inc { | |
my ($num, $cb) = @_; | |
return Mojo::IOLoop->next_tick(sub {$cb->('error')}) unless $num =~ /^\d+$/; |
NewerOlder