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 bench-type-tiny.pl | |
Rate shortcutly params_validate stately lexically | |
shortcutly 9137/s -- -86% -96% -96% | |
params_validate 67202/s 635% -- -68% -68% | |
stately 207567/s 2172% 209% -- -2% | |
lexically 212347/s 2224% 216% 2% -- |
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 | |
use strict; | |
use warnings; | |
use 5.010; | |
use Carp; | |
package Supercali; | |
use Moose; |
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 | |
use strict; | |
use warnings; | |
use 5.010; | |
use Carp; | |
eval 'require Package::Reloaded'; | |
if ($@) { say "exception: $@" } |
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
use 5.010; | |
use strict; | |
use warnings; | |
use Module::Build; | |
my $class = Module::Build->subclass(code => q{sub _share_dir_map { | |
my ($self, $prefix, $list) = @_; | |
my %files; | |
for my $dir ( @$list ) { | |
for my $f ( @{ $self->rscan_dir( $dir, sub {-f and not m/\B.svn/} )} ) { |
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
use strict; | |
use warnings; | |
use 5.012; | |
use Carp; | |
use Moose; | |
use Moose::Util qw/apply_all_roles with_traits/; | |
use Test::More; | |
{ |
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 | |
use strict; | |
use warnings; | |
use IO::File; | |
my $target = shift or die 'no arg? go away'; | |
open my $fh, '>', $target |
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 | |
use strict; | |
use warnings; | |
use 5.010; | |
my $escape = 0; | |
while (not $escape) { |
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 | |
use strict; | |
use warnings; | |
use 5.010; | |
use Carp; | |
use Params::Validate qw/validate/; | |
use Benchmark qw/cmpthese/; |
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 | |
use strict; | |
use warnings; | |
use 5.010; | |
use JSON; | |
my $number = 3.5; | |
my $string = 3.5; |
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
get '/routers' => sub { | |
my $routers = schema->resultset('Router')->search({}, | |
{ join => [ qw/network device_type/ ], | |
prefetch => [ qw/network device_type/ ], | |
order_by => 'me.name' }); | |
my $networks = schema->resultset('Network')->search({}, | |
{ order_by => 'name' }); |