Skip to content

Instantly share code, notes, and snippets.

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] } };
};
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
package async;
use Dancer2;
use DDP;
use Time::HiRes qw/gettimeofday usleep/;
our $VERSION = '0.1';
get '/' => sub {
template 'index';
#!/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;
#!/usr/bin/env perl6
use v6;
#use Grammar::Debugger;
grammar TEST {
token TOP {
<row>
}
#!/usr/bin/env perl6
use v6;
#use Grammar::Debugger;
grammar TEST {
token TOP {
<row>
}
#!/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