Plack-App-MCCS
view release on metacpan or search on metacpan
local/lib/perl5/MooseX/Has/Sugar/Saccharin.pm view on Meta::CPAN
## no critic (ProhibitBuiltinHomonyms)
sub default(&) {
my $code = shift;
return (
'default',
sub {
my $self = $_[0];
local $_ = $self;
return $code->();
},
);
}
sub trigger(&) {
my $code = shift;
return (
'trigger',
sub {
my $self = $_[0];
local $_ = $self;
return $code->();
},
);
}
local/lib/perl5/Plack/Builder.pm view on Meta::CPAN
$app;
}
# DSL goes here
our $_add = our $_add_if = our $_mount = sub {
Carp::croak("enable/mount should be called inside builder {} block");
};
sub enable { $_add->(@_) }
sub enable_if(&$@) { $_add_if->(@_) }
sub mount {
my $self = shift;
if (Scalar::Util::blessed($self)) {
$self->_mount(@_);
}else{
$_mount->($self, @_);
}
}
sub builder(&) {
my $block = shift;
my $self = __PACKAGE__->new;
my $mount_is_called;
my $urlmap = Plack::App::URLMap->new;
local $_mount = sub {
$mount_is_called++;
$urlmap->map(@_);
$urlmap;
local/lib/perl5/Plack/Runner.pm view on Meta::CPAN
env => $ENV{PLACK_ENV},
loader => 'Plack::Loader',
includes => [],
modules => [],
default_middleware => 1,
@_,
}, $class;
}
# delay the build process for reloader
sub build(&;$) {
my $block = shift;
my $app = shift || sub { };
return sub { $block->($app->()) };
}
sub parse_options {
my $self = shift;
local @ARGV = @_;
local/lib/perl5/x86_64-linux-thread-multi/AnyEvent.pm view on Meta::CPAN
$VERBOSE = length $ENV{PERL_ANYEVENT_VERBOSE} ? $ENV{PERL_ANYEVENT_VERBOSE}*1 : 4;
my $idx;
$PROTOCOL{$_} = ++$idx
for reverse split /\s*,\s*/,
$ENV{PERL_ANYEVENT_PROTOCOLS} || "ipv4,ipv6";
}
our @post_detect;
sub post_detect(&) {
my ($cb) = @_;
push @post_detect, $cb;
defined wantarray
? bless \$cb, "AnyEvent::Util::postdetect"
: ()
}
sub AnyEvent::Util::postdetect::DESTROY {
local/lib/perl5/x86_64-linux-thread-multi/AnyEvent.pm view on Meta::CPAN
our $POSTPONE_W;
our @POSTPONE;
sub _postpone_exec {
undef $POSTPONE_W;
&{ shift @POSTPONE }
while @POSTPONE;
}
sub postpone(&) {
push @POSTPONE, shift;
$POSTPONE_W ||= AE::timer (0, 0, \&_postpone_exec);
()
}
sub log($$;@) {
# only load the big bloated module when we actually are about to log something
if ($_[0] <= ($VERBOSE || 1)) { # also catches non-numeric levels(!) and fatal
local/lib/perl5/x86_64-linux-thread-multi/AnyEvent/Socket.pm view on Meta::CPAN
for @aliases;
} elsif (my $ip = parse_ipv6 $addr) {
($ip) = $ip =~ /^(.*)$/s if AnyEvent::TAINT;
push @{ $HOSTS{$_}[1] }, $ip
for @aliases;
}
}
}
# helper function - unless dns delivered results, check and parse hosts, then call continuation code
sub _load_hosts_unless(&$@) {
my ($cont, $cv, @dns) = @_;
if (@dns) {
$cv->end;
} else {
my $etc_hosts = length $ENV{PERL_ANYEVENT_HOSTS} ? $ENV{PERL_ANYEVENT_HOSTS}
: AnyEvent::WIN32 ? "$ENV{SystemRoot}/system32/drivers/etc/hosts"
: "/etc/hosts";
push @HOSTS_CHECKING, sub {
local/lib/perl5/x86_64-linux-thread-multi/AnyEvent/Util.pm view on Meta::CPAN
exit 1;
} elsif (($! != &Errno::EAGAIN && $! != &Errno::EWOULDBLOCK && $! != &Errno::ENOMEM) || !$forks) {
# we ignore some errors as long as we can run at least one job
# maybe we should wait a few seconds and retry instead
die "fork_call: $!";
}
}
}
sub fork_call(&@) {
push @fork_queue, [@_];
_fork_schedule;
}
END {
if (AnyEvent::WIN32) {
while ($forks) {
@fork_queue = ();
AnyEvent->one_event;
}
( run in 0.769 second using v1.01-cache-2.11-cpan-e5176c747c2 )