This file contains 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
package foo; | |
use Dancer2; | |
use Time::HiRes qw/gettimeofday usleep/; | |
post '/' => sub { | |
my $data = from_json( request->body ); | |
usleep 500_000; | |
to_json { result => { user => $data->{username}, time => [gettimeofday] } }; | |
}; |
This file contains 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
perl -Mojo -E 'use Time::HiRes qw/gettimeofday usleep/; post "/" => sub { my $c = shift; my $hash = $c->req->json; usleep 500000; $c->render(json => { result => { user => $hash{user}, time => [gettimeofday] } }) }; app->start' prefork |
This file contains 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
package async; | |
use Dancer2; | |
use DDP; | |
use Time::HiRes qw/gettimeofday usleep/; | |
our $VERSION = '0.1'; | |
get '/' => sub { | |
template 'index'; |
This file contains 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/env perl | |
use strict; | |
use warnings; | |
use feature qw/say/; | |
use Net::Async::HTTP; | |
use IO::Async::Loop::EV; | |
use Future::Utils qw/fmap_void/; | |
use JSON::MaybeXS; |
This file contains 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/env perl6 | |
use v6; | |
#use Grammar::Debugger; | |
grammar TEST { | |
token TOP { | |
<row> | |
} |
This file contains 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/env perl6 | |
use v6; | |
#use Grammar::Debugger; | |
grammar TEST { | |
token TOP { | |
<row> | |
} |
This file contains 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 | |
use strict; | |
use warnings; | |
use feature 'say'; | |
#use Regexp::Debugger; | |
my $string =<<'ERROR'; | |
===SORRY!=== Error while compiling /home/user/file.pl6 | |
Two terms in a row |