view release on metacpan or search on metacpan
lib/RFID/Matrics/Reader.pm view on Meta::CPAN
0xF7 => "READER - Zero Power",
0xFF => "READER - Undefined error",
);
# Prototype
sub uniq(&@);
sub _setdefaults
{
my $self = shift;
my($p)=@_;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/RWDE/DB/Record.pm view on Meta::CPAN
# Note that transaction closures may be nested within each-other however any nested transactions are essentially no-ops.
# This enables you to guarantee that any particular method will be within a transaction if you require.
# -
# In the event that you require transactions across multiple connections you should see "prepare_transaction"
# ¶m code the requested code to be executed within a transaction
sub transaction(&) {
my $code = shift;
if (!RWDE::DB::DbRegistry->transaction_signalled) {
try {
RWDE::DB::DbRegistry->signal_transaction();
lib/RWDE/DB/Record.pm view on Meta::CPAN
# Before executing the enclosed code, RWDE::DB::DbRegistry will signal the database backend to start a transaction on the first connection
# that is utilized within the code. A transaction can only operate on one connection at a time - otherwise an exception is thrown.
# In the event that you want to submit or abort the prepared transaction see "commit_transaction" & "abort_transaction"
# @param code the requested code to be executed within a transaction
# @return string representing the database handle of the prepared transaction
sub prepare_transaction(&) {
my $code = shift;
if (RWDE::DB::DbRegistry->transaction_signalled) {
throw RWDE::DevelException({ info => "Attempt to nest a named transaction within a previously established transaction." });
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Raisin/API.pm view on Meta::CPAN
sub params { $SETTINGS{params} = \@_ }
sub requires { (requires => { name => @_ }) }
sub optional { (optional => { name => @_ }) }
sub group(&) { (encloses => [shift->()]) }
# Swagger
sub desc { $SETTINGS{desc} = shift }
sub entity { $SETTINGS{entity} = shift }
sub summary { $SETTINGS{summary} = shift }
view all matches for this distribution
view release on metacpan or search on metacpan
lib/RapidApp/Data/Dmap.pm view on Meta::CPAN
}
sub cut { die bless [@_], 'Data::Dmap::Cut' }
# Stub that inserts empty map cache
sub dmap(&@) { _dmap({}, @_) }
=head1 AUTHOR
Michael Zedeler, C<< <michael@zedeler.dk> >>
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Rc/Csh.pm view on Meta::CPAN
use vars qw($level %Local $Backq);
$level = 0;
sub HELP { die "Will a 'csh' expert please step forward?" }
sub indent(&) { local $level = $level + 1; shift->() }
sub nl() { "\n" . ' 'x($level*4) }
sub Rc::Node::csh {
print $OutputFH shift->chp(). "\n";
}
view all matches for this distribution
view release on metacpan or search on metacpan
} or plan skip_all => 'redis-server is required to this test';
wait_port($port, 10);
return $redis_server;
}
sub timer(&) {
my $code_ref = shift;
my $t0 = [ gettimeofday ];
my $r = $code_ref->();
my $elapsed = tv_interval($t0);
return $r, $elapsed;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Rex/Apache/Deploy/Symlink.pm view on Meta::CPAN
};
=cut
sub generate_deploy_directory(&) {
$generate_deploy_directory = shift;
}
############ helper functions #############
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Rex/Commands.pm view on Meta::CPAN
sub FALSE {
return 0;
}
sub make(&) {
return $_[0];
}
1;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Router/Resource.pm view on Meta::CPAN
bless { @_, routes => [] };
}
our (%METHS, $ROUTER);
sub router(&;@) {
my ($block, @settings) = @_;
local $ROUTER = __PACKAGE__->new(@settings);
$block->();
return $ROUTER;
}
lib/Router/Resource.pm view on Meta::CPAN
push @{ $ROUTER->{routes} }, Router::Simple::Route->new(
$path, { meths => { %METHS } }
);
}
sub missing(&) { $ROUTER->{missing} = shift }
sub GET(&) { $METHS{GET} = shift }
sub HEAD(&) { $METHS{HEAD} = shift }
sub POST(&) { $METHS{POST} = shift }
sub PUT(&) { $METHS{PUT} = shift }
sub DELETE(&) { $METHS{DELETE} = shift }
sub OPTIONS(&) { $METHS{OPTIONS} = shift }
sub TRACE(&) { $METHS{TRACE} = shift }
sub CONNECT(&) { $METHS{CONNECT} = shift }
sub PATCH(&) { $METHS{PATCH} = shift }
sub dispatch {
my ($self, $env) = @_;
my $match = $self->match($env);
if (my $meth = $match->{meth}) {
view all matches for this distribution
view release on metacpan or search on metacpan
t/lib/Util.pm view on Meta::CPAN
use Tie::IxHash;
use Test::More;
our @EXPORT = qw(capture_warn mk_errstr mk_test ordered_hashref);
sub capture_warn(&) {
my $code = shift;
open my $fh, '>', \my $content;
$fh->autoflush(1);
local *STDERR = $fh;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DBIx/Interp.pm view on Meta::CPAN
sub new {
shift;
return DBIx::Interp::db->new(@_);
}
sub _wrap(&) {
my $code = shift;
my $x;
my @x;
my $want = wantarray();
eval {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DBIx/Interpolate.pm view on Meta::CPAN
key_field
make_dbi_interp
)]);
our @EXPORT_OK = @{$EXPORT_TAGS{all}};
sub _wrap(&);
# internal helper function to filter use parameters
sub _filter_params {
my ($skip_names, $skip_keys, @parts) = @_;
my @out;
lib/DBIx/Interpolate.pm view on Meta::CPAN
}
return \@col;
};
}
sub _wrap(&) {
my $code = shift;
my $x;
my @x;
my $want = wantarray();
eval {
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Test/Base.pm view on Meta::CPAN
ok $actual eq $expected, $name;
diag Text::Diff::diff(\$expected, \$actual);
}
}
sub run(&;$) {
(my ($self), @_) = find_my_self(@_);
my $callback = shift;
for my $block (@{$self->block_list}) {
$block->run_filters unless $block->is_filtered;
&{$callback}($block);
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Test/Base.pm view on Meta::CPAN
ok $actual eq $expected,
$name . "\n" . Text::Diff::diff(\$expected, \$actual);
}
}
sub run(&;$) {
(my ($self), @_) = find_my_self(@_);
my $callback = shift;
for my $block (@{$self->block_list}) {
$block->run_filters unless $block->is_filtered;
&{$callback}($block);
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Test/Base.pm view on Meta::CPAN
ok $actual eq $expected,
$name . "\n" . Text::Diff::diff(\$expected, \$actual);
}
}
sub run(&;$) {
(my ($self), @_) = find_my_self(@_);
my $callback = shift;
for my $block (@{$self->block_list}) {
$block->run_filters unless $block->is_filtered;
&{$callback}($block);
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Test/Base.pm view on Meta::CPAN
ok $actual eq $expected,
$name . "\n" . Text::Diff::diff(\$expected, \$actual);
}
}
sub run(&;$) {
(my ($self), @_) = find_my_self(@_);
my $callback = shift;
for my $block (@{$self->block_list}) {
$block->run_filters unless $block->is_filtered;
&{$callback}($block);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Scalar/Dynamizer.pm view on Meta::CPAN
'bool' => sub { ${ $_[0] } },
'""' => sub { ${ $_[0] } },
'0+' => sub { ${ $_[0] } },
fallback => 1;
sub dynamize(&) {
my ($code) = @_;
my $scalar;
if ( ref($code) ne 'CODE' ) {
croak('dynamize{} requires a code reference');
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Scalar/IfDefined.pm view on Meta::CPAN
our $VERSION = '0.09';
sub ifdef(&$) {
scalar &lifdef;
}
sub lifdef (&$) {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Scalar/Lazy.pm view on Meta::CPAN
$code = sub { $val };
}
bless $code, $pkg;
}
sub lazy(&;$) { __PACKAGE__->new(@_) }
*delay = \&lazy;
sub force($){
my $pkg = ref $_[0];
bless $_[0], $pkg . '::FORCE';
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Scalar/Util.pm view on Meta::CPAN
*$_ = \&{ $builtins->{$_} } for (qw( blessed refaddr reftype weaken unweaken ));
*isweak = \&{ $builtins->{is_weak} }; # renamed
}
# set_prototype has been moved to Sub::Util with a different interface
sub set_prototype(&$)
{
my ( $code, $proto ) = @_;
return Sub::Util::set_prototype( $proto, $code );
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Scope/Guard.pm view on Meta::CPAN
my $dismiss = @_ ? shift : 1;
$self->[0] = $dismiss;
}
sub guard(&) { __PACKAGE__->new(shift) }
sub scope_guard($) { __PACKAGE__->new(shift) }
sub DESTROY {
my $self = shift;
my ($dismiss, $handler) = @$self;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Scope/Session.pm view on Meta::CPAN
my ( $self, $key ) = @_;
return $self->_option->{$key};
}
sub start(&){
my $code = shift;
my $class = __PACKAGE__;
croak(q{scope session is alreay started})
if( $_IS_IN_SESSION );
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Scope/With.pm view on Meta::CPAN
=end comment
=cut
sub with(&) { $_[0]->() }
sub import {
my $class = shift;
my $keyword = shift || 'with';
my $caller = Devel::Declare::get_curstash_name;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Sepia.pm view on Meta::CPAN
is qualified, only in one package. If C<$is_regex> is true, the
non-package part of C<$name> is a regular expression.
=cut
sub my_walksymtable(&*)
{
no strict;
my ($f, $st) = @_;
local *_walk = sub {
local ($stash) = @_;
view all matches for this distribution
view release on metacpan or search on metacpan
t/090_thaw.t view on Meta::CPAN
$s =~ s/\A\s+//;
$s =~ s/\s+\z//;
return $s;
}
sub no_warnings(&) {
my @warn;
local $SIG{__WARN__} = sub { push @warn, $_[0] };
$_[0]->();
return @warn == 0;
}
view all matches for this distribution
view release on metacpan or search on metacpan
benchmarks/intersect.pl view on Meta::CPAN
}
return keys %set;
}
sub intersection_delete_fn(&@) {
my $func = shift;
my $first = shift;
do { return unless @$_ } for @_;
benchmarks/intersect.pl view on Meta::CPAN
my %set;
undef @set{@{$_[0]}};
return grep { exists $set{$_} } @{$_[1]};
}
sub intersection_grep_defined_fn(&@) {
my $func = shift;
my $lhs = shift;
return unless $lhs && @$lhs;
benchmarks/intersect.pl view on Meta::CPAN
@set{ map { $func->($_) } @int } = @int;
}
return keys %set;
}
sub intersection_grep_exists_fn(&@) {
my $func = shift;
my $lhs = shift;
return unless $lhs && @$lhs;
benchmarks/intersect.pl view on Meta::CPAN
@set{ map { $func->($_) } @int } = @int;
}
return keys %set;
}
sub intersection_grep_exists_fn_2(&@) {
my $func = shift;
my $lhs = shift;
return unless $lhs && @$lhs;
view all matches for this distribution
view release on metacpan or search on metacpan
my($set, $n) = @_;
$set->inset(-$n)
}
sub grep_set(&$)
{
my($block, $set) = @_;
return undef if $set->{negInf} or $set->{posInf};
$sub_set->{edges} = \@sub_edges;
$sub_set
}
sub map_set(&$)
{
my($block, $set) = @_;
return undef if $set->{negInf} or $set->{posInf};
$map_set
}
sub grep_spans(&$)
{
my($block, $set) = @_;
my @edges = @{$set->{edges}};
my $sub_set = $set->new;
$sub_set->{edges} = \@sub_edges;
$sub_set
}
sub map_spans(&$)
{
my($block, $set) = @_;
my @edges = @{$set->{edges}};
my @spans;
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Test/Base.pm view on Meta::CPAN
ok $actual eq $expected,
$name . "\n" . Text::Diff::diff(\$expected, \$actual);
}
}
sub run(&;$) {
(my ($self), @_) = find_my_self(@_);
my $callback = shift;
for my $block (@{$self->block_list}) {
$block->run_filters unless $block->is_filtered;
&{$callback}($block);
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Test/Base.pm view on Meta::CPAN
ok $actual eq $expected,
$name . "\n" . Text::Diff::diff(\$expected, \$actual);
}
}
sub run(&;$) {
(my ($self), @_) = find_my_self(@_);
my $callback = shift;
for my $block (@{$self->block_list}) {
$block->run_filters unless $block->is_filtered;
&{$callback}($block);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Simple/Timer.pm view on Meta::CPAN
use Time::HiRes;
use Time::Stopwatch;
tie our($TIMER), 'Time::Stopwatch';
sub timer(&) {
local $TIMER = 0;
shift->();
say $TIMER;
}
view all matches for this distribution