view release on metacpan or search on metacpan
inc/Test/Base.pm view on Meta::CPAN
eval { require Text::Diff; 1 } &&
$Text::Diff::VERSION >= 0.35 &&
$Algorithm::Diff::VERSION >= 1.15;
}
sub is($$;$) {
(my ($self), @_) = find_my_self(@_);
my ($actual, $expected, $name) = @_;
local $Test::Builder::Level = $Test::Builder::Level + 1;
if ($ENV{TEST_SHOW_NO_DIFFS} or
not defined $actual or
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Test/Base.pm view on Meta::CPAN
eval { require Text::Diff; 1 } &&
$Text::Diff::VERSION >= 0.35 &&
$Algorithm::Diff::VERSION >= 1.15;
}
sub is($$;$) {
(my ($self), @_) = find_my_self(@_);
my ($actual, $expected, $name) = @_;
local $Test::Builder::Level = $Test::Builder::Level + 1;
if ($ENV{TEST_SHOW_NO_DIFFS} or
not defined $actual or
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Test/Base.pm view on Meta::CPAN
eval { require Text::Diff; 1 } &&
$Text::Diff::VERSION >= 0.35 &&
$Algorithm::Diff::VERSION >= 1.15;
}
sub is($$;$) {
(my ($self), @_) = find_my_self(@_);
my ($actual, $expected, $name) = @_;
local $Test::Builder::Level = $Test::Builder::Level + 1;
if ($ENV{TEST_SHOW_NO_DIFFS} or
not defined $actual or
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Test/Base.pm view on Meta::CPAN
eval { require Text::Diff; 1 } &&
$Text::Diff::VERSION >= 0.35 &&
$Algorithm::Diff::VERSION >= 1.15;
}
sub is($$;$) {
(my ($self), @_) = find_my_self(@_);
my ($actual, $expected, $name) = @_;
local $Test::Builder::Level = $Test::Builder::Level + 1;
if ($ENV{TEST_SHOW_NO_DIFFS} or
not defined $actual or
view all matches for this distribution
view release on metacpan or search on metacpan
t/30_v1_tests.t view on Meta::CPAN
use Lingua::TR::Numbers qw(num2tr num2tr_ordinal);
_log "# Using Lingua::TR::Numbers v$Lingua::TR::Numbers::VERSION\n";
sub N ($) { return num2tr( shift) }
sub O ($) { return num2tr_ordinal(shift) }
is N 0, 'sıfır', 'num2tr';
is N 1, 'bir', 'num2tr';
is N 2, 'iki', 'num2tr';
is N 3, 'üç', 'num2tr';
view all matches for this distribution
view release on metacpan or search on metacpan
lib/List/Comprehensions.pm view on Meta::CPAN
eg: PF( [0..5], ['a'..'z'] )
is: [ 0, 'a', 1,'b' ... 5,'f' ]
=cut
sub PF($$;@) {
return zipn_flat(@_);
}
sub zipn {
my @ret = ();
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Test/Base.pm view on Meta::CPAN
eval { require Text::Diff; 1 } &&
$Text::Diff::VERSION >= 0.35 &&
$Algorithm::Diff::VERSION >= 1.15;
}
sub is($$;$) {
(my ($self), @_) = find_my_self(@_);
my ($actual, $expected, $name) = @_;
local $Test::Builder::Level = $Test::Builder::Level + 1;
if ($ENV{TEST_SHOW_NO_DIFFS} or
not defined $actual or
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Test/Base.pm view on Meta::CPAN
eval { require Text::Diff; 1 } &&
$Text::Diff::VERSION >= 0.35 &&
$Algorithm::Diff::VERSION >= 1.15;
}
sub is($$;$) {
(my ($self), @_) = find_my_self(@_);
my ($actual, $expected, $name) = @_;
local $Test::Builder::Level = $Test::Builder::Level + 1;
if ($ENV{TEST_SHOW_NO_DIFFS} or
not defined $actual or
view all matches for this distribution
view release on metacpan or search on metacpan
lib/List/oo.pm view on Meta::CPAN
=back
=cut
sub F (&) {
my $sub = CORE::shift(@_);
@_ and croak;
UNIVERSAL::isa($sub, 'CODE') and return($sub);
eval($sub->isa('List::oo')) and croak 'not a method';
croak('why bother');
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Locale/Maketext/Gettext/Functions.pm view on Meta::CPAN
# Prototype declaration
sub bindtextdomain($;$);
sub textdomain(;$);
sub get_handle(@);
sub maketext(@);
sub __(@);
sub N_(@);
sub dmaketext($$@);
sub pmaketext($$@);
sub dpmaketext($$$@);
sub reload_text();
sub encoding(;$);
lib/Locale/Maketext/Gettext/Functions.pm view on Meta::CPAN
sub _get_langs($$);
sub _get_handle();
sub _get_empty_handle();
sub _reset();
sub _new_rid();
sub _k($);
sub _lang($);
use Encode qw(encode decode from_to FB_DEFAULT);
use File::Spec::Functions qw(catdir catfile);
use Locale::Maketext::Gettext qw(read_mo);
lib/Locale/Maketext/Gettext/Functions.pm view on Meta::CPAN
return __($_[0], @_[1..$#_]);
}
# Maketext, in its shortcut name
# Use @ instead of $@ in prototype, so that we can pass @_ to it.
sub __(@) {
local ($_, %_);
my ($key, @param, $keyd);
($key, @param) = @_;
# Reset the current language handle if it is not set yet
_get_handle() if !defined $LH;
lib/Locale/Maketext/Gettext/Functions.pm view on Meta::CPAN
}
# Return the original text untouched, so that it can be cached
# with xgettext
# Use @ instead of $@ in prototype, so that we can pass @_ to it.
sub N_(@) {
# Watch out for this Perl magic! :p
return $_[0] unless wantarray;
return @_;
}
lib/Locale/Maketext/Gettext/Functions.pm view on Meta::CPAN
return $id;
}
# Build the key for the domain registry
sub _k($) {
return join "\n", $LOCALEDIRS{$_[0]}, $CATEGORY, $_[0];
}
# The language from a language handle. language_tag is not quite sane.
sub _lang($) {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Locale/TextDomain/Mock.pm view on Meta::CPAN
$translation =~ s/\{($re)\}/defined $args{$1} ? $args{$1} : "{$1}"/ge;
$translation;
}
# plain string
sub __($) {
$_[0];
}
# interpolation
sub __x($@) {
view all matches for this distribution
view release on metacpan or search on metacpan
bin/log-defer-viz view on Meta::CPAN
$columns = $term_cols if $term_cols;
## The _ sub is a shortcut for use in --grep, --map, and --count expressions, ie --grep "_->{data}"
sub _ () { $_ }
if ($opt->{grep}) {
my $expr = $opt->{grep};
$opt->{grep} = eval('sub { local $_ = $_[0]; ' . "$expr\n" . '}');
die "Error compiling --grep expression '$expr' ($@)" if $@;
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Test/Base.pm view on Meta::CPAN
eval { require Text::Diff; 1 } &&
$Text::Diff::VERSION >= 0.35 &&
$Algorithm::Diff::VERSION >= 1.15;
}
sub is($$;$) {
(my ($self), @_) = find_my_self(@_);
my ($actual, $expected, $name) = @_;
local $Test::Builder::Level = $Test::Builder::Level + 1;
if ($ENV{TEST_SHOW_NO_DIFFS} or
not defined $actual or
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Test/Base.pm view on Meta::CPAN
eval { require Text::Diff; 1 } &&
$Text::Diff::VERSION >= 0.35 &&
$Algorithm::Diff::VERSION >= 1.15;
}
sub is($$;$) {
(my ($self), @_) = find_my_self(@_);
my ($actual, $expected, $name) = @_;
local $Test::Builder::Level = $Test::Builder::Level + 1;
if ($ENV{TEST_SHOW_NO_DIFFS} or
not defined $actual or
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Log/Report/Minimal.pm view on Meta::CPAN
our @EXPORT_OK = (@make_msg, @functions, @reason_functions);
sub trace(@); sub assert(@); sub info(@); sub notice(@); sub warning(@);
sub mistake(@); sub error(@); sub fault(@); sub alert(@); sub failure(@);
sub panic(@); sub report(@); sub textdomain($@);
sub __($); sub __x($@); sub __n($$$@); sub __nx($$$@); sub __xn($$$@);
sub N__($); sub N__n($$); sub N__w(@);
my ($mode, %need);
sub need($)
{ $mode = shift;
lib/Log/Report/Minimal.pm view on Meta::CPAN
sub failure(@) {_report {}, FAILURE => @_}
sub panic(@) {_report {}, PANIC => @_}
#--------------------
sub __($) { $_[0] }
sub __x($@)
{ @_%2 or error __x"even length parameter list for __x at {where}", where => join(' line ', (caller)[1,2]);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Log/Report.pm view on Meta::CPAN
sub _whats_needed(); sub dispatcher($@); sub textdomain(@);
sub trace(@); sub assert(@); sub info(@); sub notice(@); sub warning(@);
sub mistake(@); sub error(@); sub fault(@); sub alert(@); sub failure(@);
sub panic(@);
sub __($); sub __x($@); sub __n($$$@); sub __nx($$$@); sub __xn($$$@);
sub N__($); sub N__n($$); sub N__w(@);
sub __p($$); sub __px($$@); sub __np($$$$); sub __npx($$$$@);
#
# Some initiations
lib/Log/Report.pm view on Meta::CPAN
sub panic(@) {report PANIC => @_}
#--------------------
sub __($)
{ my ($cpkg, $fn, $linenr) = caller;
$lrm->new(_msgid => shift, _domain => pkg2domain($cpkg), _use => "$fn line $linenr");
}
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Test/Base.pm view on Meta::CPAN
eval { require Text::Diff; 1 } &&
$Text::Diff::VERSION >= 0.35 &&
$Algorithm::Diff::VERSION >= 1.15;
}
sub is($$;$) {
(my ($self), @_) = find_my_self(@_);
my ($actual, $expected, $name) = @_;
local $Test::Builder::Level = $Test::Builder::Level + 1;
if ($ENV{TEST_SHOW_NO_DIFFS} or
not defined $actual or
view all matches for this distribution
view release on metacpan or search on metacpan
eg/mp3tag.PL view on Meta::CPAN
sub dlg_cancel {
my($self) = @_;
$self->dispose();
}
#-----------------------------------------------------------------#
sub r ($$$$) {Rect->new(@_)}
#-----------------------------------------------------------------#
sub set_dialog {
my($ref, $file, $tag) = @_;
$tag = $ref->{TAG};
SetDialogFont(geneva());
view all matches for this distribution
view release on metacpan or search on metacpan
lib/MPEG/Audio/Frame.pm view on Meta::CPAN
[ 136, 256 ], # layer three
);
my @consts;
sub B ($) { $_[0] == 12 ? 3 : (1 + ($_[0] / 4)) }
sub M ($) {
my $s = 0;
$s += $consts[$_][1] for (0 .. $_[0]-1);
$s%=8;
my $v = '';
vec($v,8-$_,1) = 1 for $s+1 .. $s+$consts[$_[0]][1];
"0x" . unpack("H*", $v);
}
sub R ($) {
my $i = 0;
my $m = eval "M_$consts[$_[0]][0]()";
$i++ until (($m >> $i) & 1);
$i;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Mackerel/Webhook/Receiver/Declare.pm view on Meta::CPAN
local $_RECEIVER = Mackerel::Webhook::Receiver->new;
$code->();
$_RECEIVER;
}
sub on($;$) {
die 'not in receiver block' unless $_RECEIVER;
$_RECEIVER->on(@_);
}
1;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Mail/IMAPClient.pm view on Meta::CPAN
sub sentbefore($$) { shift->_search_date( sentbefore => @_ ) }
sub sentsince($$) { shift->_search_date( sentsince => @_ ) }
sub senton($$) { shift->_search_date( senton => @_ ) }
sub since($$) { shift->_search_date( since => @_ ) }
sub before($$) { shift->_search_date( before => @_ ) }
sub on($$) { shift->_search_date( on => @_ ) }
sub _search_date($$$) {
my ( $self, $how, $time ) = @_;
my $imapdate;
view all matches for this distribution
view release on metacpan or search on metacpan
MboxParser/Mail.pm view on Meta::CPAN
=back
=cut
sub to() { shift->_recipients("to") }
# ----------------------------------------------------------------
=over 4
MboxParser/Mail.pm view on Meta::CPAN
=back
=cut
sub cc() { shift->_recipients("cc") }
# ----------------------------------------------------------------
=over 4
MboxParser/Mail.pm view on Meta::CPAN
=back
=cut
sub id() {
my $self = shift;
$self->reset_last;
$self->header->{'message-id'} =~ /\<(.*)\>/;
$1;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Mail/Message.pm view on Meta::CPAN
my $sender = $self->head->get('Sender') || $self->head->get('From');
$sender ? ($sender->addresses)[0] : (); # first specified address
}
sub to() { map $_->addresses, $_[0]->head->get('To') }
sub cc() { map $_->addresses, $_[0]->head->get('Cc') }
sub bcc() { map $_->addresses, $_[0]->head->get('Bcc') }
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Test/Base.pm view on Meta::CPAN
$Text::Diff::VERSION >= 0.35 &&
$Algorithm::Diff::VERSION >= 1.15;
}
provides 'is';
sub is($$;$) {
(my ($self), @_) = find_my_self(@_);
my ($actual, $expected, $name) = @_;
local $Test::Builder::Level = $Test::Builder::Level + 1 unless $HAS_PROVIDER;
if ($ENV{TEST_SHOW_NO_DIFFS} or
not defined $actual or
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Test/Base.pm view on Meta::CPAN
$Text::Diff::VERSION >= 0.35 &&
$Algorithm::Diff::VERSION >= 1.15;
}
provides 'is';
sub is($$;$) {
(my ($self), @_) = find_my_self(@_);
my ($actual, $expected, $name) = @_;
local $Test::Builder::Level = $Test::Builder::Level + 1 unless $HAS_PROVIDER;
if ($ENV{TEST_SHOW_NO_DIFFS} or
not defined $actual or
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Math/Algebra/Symbols/Sum.pm view on Meta::CPAN
Get the single term from a sum containing just one term
=cut
sub st($)
{my ($a) = @_;
return (values(%{$a->{t}}))[0] if scalar(keys(%{$a->{t}})) == 1;
undef;
}
lib/Math/Algebra/Symbols/Sum.pm view on Meta::CPAN
Real part of a complex sum
=cut
sub re($)
{my ($A) = @_;
$A = newFromString("$A") unless ref($A) eq __PACKAGE__;
my @r;
for my $a($A->t)
{next if $a->i == 1;
lib/Math/Algebra/Symbols/Sum.pm view on Meta::CPAN
Imaginary part of a complex sum
=cut
sub im($)
{my ($A) = @_;
$A = newFromString("$A") unless ref($A) eq __PACKAGE__;
my @r;
for my $a($A->t)
{next if $a->i == 0;
lib/Math/Algebra/Symbols/Sum.pm view on Meta::CPAN
Get Id of sum: each sum has a unique identifying number.
=cut
sub id($)
{my ($t) = @_;
$t->{id} or die "Sum $t not yet finalized";
$t->{id};
}
lib/Math/Algebra/Symbols/Sum.pm view on Meta::CPAN
Check sum finalized. See: L</z>.
=cut
sub zz($)
{my ($t) = @_;
$t->{z} or die "Sum $t not yet finalized";
print $t->{z}, "\n";
$t;
}
view all matches for this distribution
view release on metacpan or search on metacpan
examples/krzysztof_reformulated_zeta_function.pl view on Meta::CPAN
use lib qw(../lib);
use Math::AnyNum qw(:overload); # can be commented out
use Math::AnyNum qw(gamma binomial zeta factorial);
sub Ak($k) {
my $sum = 0;
foreach my $j (0 .. $k) {
$sum += (-1)**$j * binomial($k, $j) * (2 * $j + 1) * zeta(2 * $j + 2);
}
$sum;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Math/Bacovia.pm view on Meta::CPAN
#
## Import/export
#
sub i () {
'Math::Bacovia::Number'->new('Math::AnyNum'->i);
}
sub pi () {
'Math::Bacovia::Log'->new($MONE) * -i;
lib/Math/Bacovia.pm view on Meta::CPAN
sub tau () {
'Math::Bacovia::Log'->new($MONE) * -(i + i);
}
sub e () {
'Math::Bacovia::Exp'->new($ONE);
}
my %exported_functions = (
Exp => \&_exp,
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Math/Complex.pm view on Meta::CPAN
#
# i
#
# The number defined as i*i = -1;
#
sub i () {
return $i if ($i);
$i = bless {};
$i->{'cartesian'} = [0, 1];
$i->{'polar'} = [1, pip2];
$i->{c_dirty} = 0;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Math/Fibonacci.pm view on Meta::CPAN
@ISA = qw(Exporter);
( $VERSION ) = '$Revision: 1.5 $' =~ /\s(\d+\.\d+)\s/;
@EXPORT_OK = qw(term series decompose isfibonacci);
sub g () { "1.61803398874989" } # golden ratio
sub term { nearestint ((g ** shift) / sqrt(5)) } # nth term of the seq
sub series { return map(term($_), 1..shift) } # n terms of the seq
view all matches for this distribution