Result:
found more than 805 distributions - search limited to the first 2001 files matching your query ( run in 2.046 )


Data-Overlay

 view release on metacpan or  search on metacpan

lib/Data/Overlay.pm  view on Meta::CPAN

=back

=cut

for my $action (keys %action_map) {
    # debuggable names for callbacks (not the used perl names)
    subname "$action-overlay", $action_map{$action};

    # XXX
    warn "$action not in \@action_order"
        if ! grep { $action eq $_ } @action_order;

 view all matches for this distribution


Data-Pool-Shared

 view release on metacpan or  search on metacpan

xt/endurance_leak.t  view on Meta::CPAN

use strict;
use warnings;
use Test::More;

# Endurance: 500k random ops, observe RSS. Perl handle lifetimes must
# be correct — no SV leaks in XS callbacks. A growing RSS over time
# indicates a leak.

use Data::Pool::Shared;

my $p = Data::Pool::Shared::I64->new_memfd("endur", 512);

 view all matches for this distribution


Data-Processor

 view release on metacpan or  search on metacpan

lib/Data/Processor.pm  view on Meta::CPAN

}

=head2 transform_data

Transform one key in the data according to rules specified
as callbacks that themodule calls for you.
Transforms the data in-place.

 my $validator = Data::Processor::Validator->new($schema, data => $data)
 my $error_string = $processor->transform($key, $schema_key, $value);

 view all matches for this distribution


Data-Random-String-Matches

 view release on metacpan or  search on metacpan

scripts/generate_index.pl  view on Meta::CPAN

						size: 12,
						weight: 'bold'
					}
				}
			}, tooltip: {
				callbacks: {
					label: function(context) {
						const raw = context.raw;
						const coverage = raw.y.toFixed(1);
						const delta = raw.delta?.toFixed(1) ?? '0.0';
						const sign = delta > 0 ? '+' : delta < 0 ? '-' : '±';

 view all matches for this distribution


Data-Region

 view release on metacpan or  search on metacpan

Region.pm  view on Meta::CPAN

=back


=head2 Associating behavior with Data::Regions

The following methods allow you to associate data and callbacks to a
tree of Data::Regions, and to request a Data::Region to perform its tree of
callbacks. 

=over 4

=item  $r->data( [$reference] )

 view all matches for this distribution


Data-SExpression

 view release on metacpan or  search on metacpan

lib/Data/SExpression.pm  view on Meta::CPAN

    return !ref($thing) ||
            ref($thing) eq "GLOB" ||
            ref($thing) eq 'Data::SExpression::Symbol';;
}

=head1 Data::SExpression::Parser callbacks

These are for internal use only, and are used to generate the data
structures returned by L</read>. 

=head2 new_cons CAR CDR

 view all matches for this distribution





Data-SpatialHash-Shared

 view release on metacpan or  search on metacpan

t/16-pairs.t  view on Meta::CPAN

        $want{ key($p[$i][2], $p[$j][2]) } = 1 if $dx*$dx + $dy*$dy < $maxr*$maxr;
    }}
    is_deeply { map { $_ => 1 } keys %got }, \%want, 'each_pair_within matches brute force';
    ok !(grep { $_ > 1 } values %got), 'each pair emitted exactly once';

    # max_r == 0 is documented-valid: fires zero callbacks without croaking
    my $n0 = 0; eval { $s->each_pair_within(0, sub { $n0++ }) };
    is $@, '', 'each_pair_within(0) does not croak (0 is a valid max_r)';
    is $n0, 0, 'each_pair_within(0) fires zero callbacks';
}

# --- each_colliding_pair vs brute force (heterogeneous radii) ---
{
    my $s = Data::SpatialHash::Shared->new(undef, 1000, 0, 2.0);   # small cell vs big radii

 view all matches for this distribution


Data-Startup

 view release on metacpan or  search on metacpan

t/ExtUtils/SVDmaker/Algorithm/Diff.pm  view on Meta::CPAN


In addition to the 
C<DISCARD_A>,
C<DISCARD_B>, and
C<MATCH>
callbacks supported by C<traverse_sequences>, C<traverse_balanced> supports
a C<CHANGE> callback indicating that one element got C<replaced> by another:

  traverse_sequences( \@seq1, \@seq2,
                     { MATCH => $callback_1,
                       DISCARD_A => $callback_2,

t/ExtUtils/SVDmaker/Algorithm/Diff.pm  view on Meta::CPAN


sub traverse_sequences
{
	my $a                 = shift;                                  # array ref
	my $b                 = shift;                                  # array ref
	my $callbacks         = shift || {};
	my $keyGen            = shift;
	my $matchCallback     = $callbacks->{'MATCH'} || sub { };
	my $discardACallback  = $callbacks->{'DISCARD_A'} || sub { };
	my $finishedACallback = $callbacks->{'A_FINISHED'};
	my $discardBCallback  = $callbacks->{'DISCARD_B'} || sub { };
	my $finishedBCallback = $callbacks->{'B_FINISHED'};
	my $matchVector = _longestCommonSubsequence( $a, $b, $keyGen, @_ );

	# Process all the lines in @$matchVector
	my $lastA = $#$a;
	my $lastB = $#$b;

t/ExtUtils/SVDmaker/Algorithm/Diff.pm  view on Meta::CPAN


sub traverse_balanced
{
	my $a                 = shift;                                  # array ref
	my $b                 = shift;                                  # array ref
	my $callbacks         = shift || {};
	my $keyGen            = shift;
	my $matchCallback     = $callbacks->{'MATCH'} || sub { };
	my $discardACallback  = $callbacks->{'DISCARD_A'} || sub { };
	my $discardBCallback  = $callbacks->{'DISCARD_B'} || sub { };
	my $changeCallback    = $callbacks->{'CHANGE'};
	my $matchVector = _longestCommonSubsequence( $a, $b, $keyGen, @_ );

	# Process all the lines in match vector
	my $lastA = $#$a;
	my $lastB = $#$b;

 view all matches for this distribution


Data-TableAutoSum

 view release on metacpan or  search on metacpan

TableAutoSum.pm  view on Meta::CPAN

    return 1;
}

use constant ROW_COL_TYPE => {
    type      => SCALAR | ARRAYREF,
    callbacks =>  {
        # scalar value
        'integer'          => sub { implies !ref($_[0]) => $_[0] =~ $RE{num}{int} },
            'greater than 0'   => sub { implies !ref($_[0]) => ($_[0] =~ $RE{num}{int}) && (int($_[0]) > 0) },

        # array ref

TableAutoSum.pm  view on Meta::CPAN


sub data : lvalue {
    my $self = shift; 
    my ($row, $col, $value) = validate_pos( @_,
        {type => SCALAR,
         callbacks => {'is a row' => sub {$self->{rowset}->contains(shift())}}
        },
        {type => SCALAR,
         callbacks => {'is a col' => sub {$self->{colset}->contains(shift())}}
        },
        0
    );
    $self->{data}->{$row}->{$col} = $value if defined $value;
    $self->{data}->{$row}->{$col};

 view all matches for this distribution


Data-TableReader-Decoder-HTML

 view release on metacpan or  search on metacpan

lib/Data/TableReader/Decoder/HTML.pm  view on Meta::CPAN

=head1 METHODS

=head2 parse

Unfortunately, I'm not aware of any HTML parsers that properly parse a stream on demand rather
than using callbacks, so this module simply parses all the HTML up-front and iterates the perl
data structure.  This would be a problem if you have more HTML than can fit into memory
comfortably.  Buf if that's the case, you have bigger problems ;-)

This method is called automatically the first time you invoke the iterator.  You might choose
to call it earlier in order to report errors better.

 view all matches for this distribution


Data-TableReader

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

 - Decoder::Mock now correctly handles empty tables (no rows)

Version 0.020 - 2024-04-30
 - Rename on_validation_fail -> on_validation_error
   The action codes are the same, but the callback has different arguments.
   Old callbacks applied using the attribute name 'on_validation_fail' will
   continue to work.
 - New iterator attribute 'dataset_idx', for keeping track of which dataset
   you're on.
 - Unimplemented Iterator->seek now dies as per the documentation.
   (no built-in iterator lacked support for seek, so unlikely to matter)

 view all matches for this distribution


Data-Text

 view release on metacpan or  search on metacpan

scripts/generate_index.pl  view on Meta::CPAN

						size: 12,
						weight: 'bold'
					}
				}
			}, tooltip: {
				callbacks: {
					label: function(context) {
						const raw = context.raw;
						const coverage = raw.y.toFixed(1);
						const delta = raw.delta?.toFixed(1) ?? '0.0';
						const sign = delta > 0 ? '+' : delta < 0 ? '-' : '±';

 view all matches for this distribution


Data-Trace

 view release on metacpan or  search on metacpan

lib/Data/Tie/Watch.pm  view on Meta::CPAN

Note: This is a copy of Tk's Tie::Watch.
Copied to avoid the Tk depedency.

This class module binds one or more subroutines of your devising to a
Perl variable.  All variables can have B<FETCH>, B<STORE> and
B<DESTROY> callbacks.  Additionally, arrays can define B<CLEAR>,
B<DELETE>, B<EXISTS>, B<EXTEND>, B<FETCHSIZE>, B<POP>, B<PUSH>,
B<SHIFT>, B<SPLICE>, B<STORESIZE> and B<UNSHIFT> callbacks, and hashes
can define B<CLEAR>, B<DELETE>, B<EXISTS>, B<FIRSTKEY> and B<NEXTKEY>
callbacks.  If these term are unfamiliar to you, I I<really> suggest
you read L<perltie>.

With Data::Tie::Watch you can:

 . alter a variable's value

lib/Data/Tie/Watch.pm  view on Meta::CPAN

Callback format is patterned after the Perl/Tk scheme: supply either a
code reference, or, supply an array reference and pass the callback
code reference in the first element of the array, followed by callback
arguments.  (See examples in the Synopsis, above.)

Tie::Watch provides default callbacks for any that you fail to
specify.  Other than negatively impacting performance, they perform
the standard action that you'd expect, so the variable behaves
"normally".  Once you override a default callback, perhaps to insert
debug code like print statements, your callback normally finishes by
calling the underlying (overridden) method.  But you don't have to!

lib/Data/Tie/Watch.pm  view on Meta::CPAN

Watch constructor.

The *real* constructor is Data::Tie::Watch->base_watch(),
invoked by methods in other Watch packages, depending upon the variable's
type.  Here we supply defaulted parameter values and then verify them,
normalize all callbacks and bind the variable to the appropriate package.

The watchpoint constructor method that accepts option/value pairs to
create and configure the Watch object.  The only required option is
B<-variable>.

lib/Data/Tie/Watch.pm  view on Meta::CPAN

    $watch_obj->{-value} = $$variable;

    bless $watch_obj, $class;
}

# Default scalar callbacks.

sub Destroy { undef %{ $_[0] } }
sub Fetch   { $_[0]->{-value} }
sub Store   { $_[0]->{-value} = $_[1] }

lib/Data/Tie/Watch.pm  view on Meta::CPAN

    my $watch_obj = Data::Tie::Watch->base_watch( %args );

    bless $watch_obj, $class;
}

# Default array callbacks.

sub Clear     { $_[0]->{-ptr} = () }
sub Delete    { delete $_[0]->{-ptr}->[ $_[1] ] }
sub Destroy   { undef %{ $_[0] } }
sub Exists    { exists $_[0]->{-ptr}->[ $_[1] ] }

lib/Data/Tie/Watch.pm  view on Meta::CPAN

    my $watch_obj = Data::Tie::Watch->base_watch( %args );

    bless $watch_obj, $class;
}

# Default hash callbacks.

sub Clear    { $_[0]->{-ptr} = () }
sub Delete   { delete $_[0]->{-ptr}->{ $_[1] } }
sub Destroy  { undef %{ $_[0] } }
sub Exists   { exists $_[0]->{-ptr}->{ $_[1] } }

 view all matches for this distribution


Data-Transformer

 view release on metacpan or  search on metacpan

lib/Data/Transformer.pm  view on Meta::CPAN

    'My::Class' => sub { shift->set_foo('bar') }
 );

=head1 DESCRIPTION

=head2 Data type callbacks

The basic idea is that you provide a callback subroutine for each type
of data that you wish to affect or collect information from.

The constructor, C<new()>, expects a hash with at least one of the

 view all matches for this distribution


Data-TreeDumper

 view release on metacpan or  search on metacpan

TreeDumper.pm  view on Meta::CPAN


if this option is set, B<Data::TreeDumper> will use it instead for the console width.

=head1 Custom Rendering

B<Data::TreeDumper> has a plug-in interface for other rendering formats. The renderer callbacks are
set by overriding the native renderer. Thanks to Stevan Little author of Tree::Simple::View for getting
B<Data::TreeDumper> on this track. Check B<Data::TreeDumper::Renderer::DHTML>.

 DumpTree
  	(

 view all matches for this distribution


Data-Validator

 view release on metacpan or  search on metacpan

lib/Data/Validator.pm  view on Meta::CPAN

If it is a CODE reference, it is called in scalar context as
C<< $default->($validator, $rule, $args) >> and its return value
is used as a default value.

Because arguments are validated in the order of definitions, C<default>
callbacks can rely on the previously-filled values:

    my $v = Data::Validator->new(
        foo => { default => 99 },
        bar => { default => sub {
            my($validator, $this_rule, $args) = @_;

 view all matches for this distribution


Data-Verifier

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

        the field.
      * Result's value is no longer serialized.

0.10
      * Change post_check's calling convention after reading some wisdom from
        nuffin: http://blog.woobling.org/2009/09/method-style-callbacks.html
      * Change internal API to use a field class rather than a bunch of hashes.

0.09
      * Document check order
      * Clean up post-check test a bit

 view all matches for this distribution


Data-Visitor

 view release on metacpan or  search on metacpan

lib/Data/Visitor/Callback.pm  view on Meta::CPAN

package Data::Visitor::Callback;
use Moose;
# ABSTRACT: A Data::Visitor with callbacks.

our $VERSION = '0.32';
use Data::Visitor ();

use Carp qw(carp);

lib/Data/Visitor/Callback.pm  view on Meta::CPAN

use constant DEBUG => Data::Visitor::DEBUG();
use constant FIVE_EIGHT => ( $] >= 5.008 );

extends qw(Data::Visitor);

has callbacks => (
	isa => "HashRef",
	is  => "rw",
	default => sub { {} },
);

has class_callbacks => (
	isa => "ArrayRef",
	is  => "rw",
	default => sub { [] },
);

lib/Data/Visitor/Callback.pm  view on Meta::CPAN


	my $args = $class->SUPER::BUILDARGS(@args);

	my %init_args = map { $_->init_arg => undef } $class->meta->get_all_attributes;

	my %callbacks = map { $_ => $args->{$_} } grep { not exists $init_args{$_} } keys %$args;

	my @class_callbacks = do {
		no strict 'refs';
		grep {
			# this check can be half assed because an ->isa check will be
			# performed later. Anything that cold plausibly be a class name
			# should be included in the list, even if the class doesn't
			# actually exist.

			m{ :: | ^[A-Z] }x # if it looks kinda lack a class name
				or
			scalar keys %{"${_}::"} # or it really is a class
		} keys %callbacks;
	};

	# sort from least derived to most derived
	@class_callbacks = sort { !$a->isa($b) <=> !$b->isa($a) } @class_callbacks;

	return {
		%$args,
		callbacks       => \%callbacks,
		class_callbacks => \@class_callbacks,
	};
}

sub visit {
	my $self = shift;

lib/Data/Visitor/Callback.pm  view on Meta::CPAN


	$data = $self->callback_and_reg( object => $data );

	my $class_cb = 0;

	foreach my $class ( grep { $data->isa($_) } @{ $self->class_callbacks } ) {
		last unless blessed($data);
		die "Unexpected object $data found"
			unless $data->isa($class);
		$self->trace( flow => class_callback => $class, on => $data ) if DEBUG;

lib/Data/Visitor/Callback.pm  view on Meta::CPAN

}

sub callback {
	my ( $self, $name, $data, @args ) = @_;

	if ( my $code = $self->callbacks->{$name} ) {
		$self->trace( flow => callback => $name, on => $data ) if DEBUG;
		if ( wantarray ) {
			my @ret = $self->$code( $data, @args );
			return $self->ignore_return_values ? ( $data, @args ) : @ret;
		} else {

lib/Data/Visitor/Callback.pm  view on Meta::CPAN


=encoding UTF-8

=head1 NAME

Data::Visitor::Callback - A Data::Visitor with callbacks.

=head1 VERSION

version 0.32

=head1 SYNOPSIS

	use Data::Visitor::Callback;

	my $v = Data::Visitor::Callback->new(
		# you can provide callbacks
		# $_ will contain the visited value

		value => sub { ... },
		array => sub { ... },

lib/Data/Visitor/Callback.pm  view on Meta::CPAN

		# 'visit_ref' callback which normally traverse unblessed references

		object => "visit_ref",


		# you can also use class names as callbacks
		# the callback will be invoked on all objects which inherit that class

		'Some::Class' => sub {
			my ( $v, $obj ) = @_; # $v is the visitor

lib/Data/Visitor/Callback.pm  view on Meta::CPAN


	$v->visit( $some_perl_value );

=head1 DESCRIPTION

This is a L<Data::Visitor> subclass that lets you invoke callbacks instead of
needing to subclass yourself.

=head1 METHODS

=over 4

=item new %opts, %callbacks

Construct a new visitor.

The options supported are:

=over 4

=item ignore_return_values

When this is true (off by default) the return values from the callbacks are
ignored, thus disabling the fmapping behavior as documented in
L<Data::Visitor>.

This is useful when you want to modify $_ directly

lib/Data/Visitor/Callback.pm  view on Meta::CPAN


=back

=head1 CALLBACKS

Use these keys for the corresponding callbacks.

The callback is in the form:

	sub {
		my ( $visitor, $data ) = @_;

lib/Data/Visitor/Callback.pm  view on Meta::CPAN

You can use any class name as a callback. This is called only after the
C<object> callback.

If the object C<isa> the class then the callback will fire.

These callbacks are called from least derived to most derived by comparing the
classes' C<isa> at construction time.

=item object_no_class

Called for every object that did not have a class callback.

=item object_final

The last callback called for objects, useful if you want to post process the
output of any class callbacks.

=item array

Called for array references.

 view all matches for this distribution


Data-Walk

 view release on metacpan or  search on metacpan

ChangeLog  view on Meta::CPAN

	  unblessed references

2005-11-14 19:23  Guido Flohr <guido.flohr@cantanea.com>

	* README, lib/Data/Walk.pm, t/TC_Copy.pm, t/TS_All.pm: implemented
	  call-by-reference for preprocessing callbacks

2005-11-14 18:35  Guido Flohr <guido.flohr@cantanea.com>

	* README, lib/Data/Walk.pm, t/TC_Follow.pm, t/TS_All.pm: handle
	  cyclic references correctly

 view all matches for this distribution


Database-Abstraction

 view release on metacpan or  search on metacpan

lib/Database/Abstraction.pm  view on Meta::CPAN

				#	in scalar assignment in error_diag
				#	RT121127
				# auto_diag => 1,
				auto_diag => 0,
				# Don't do this, it causes "Attempt to free unreferenced scalar"
				# callbacks => {
					# after_parse => sub {
						# my ($csv, @rows) = @_;
						# my @rc;
						# foreach my $row(@rows) {
							# if($row->[0] !~ /^#/) {

 view all matches for this distribution


Date-Age

 view release on metacpan or  search on metacpan

scripts/generate_index.pl  view on Meta::CPAN

						size: 12,
						weight: 'bold'
					}
				}
			}, tooltip: {
				callbacks: {
					label: function(context) {
						const raw = context.raw;
						const coverage = raw.y.toFixed(1);
						const delta = raw.delta?.toFixed(1) ?? '0.0';
						const sign = delta > 0 ? '+' : delta < 0 ? '-' : '±';

 view all matches for this distribution


Date-Holidays-PL

 view release on metacpan or  search on metacpan

lib/Date/Holidays/PL.pm  view on Meta::CPAN

# Params::Validate config
my $ValidateOpts = {
    year => {
        type => SCALAR,
        regex => qr/^\d{4}$/,
        callbacks => {
            'between 1951 and 9999' => sub {
                shift >= 1951
            },
        },
    },

 view all matches for this distribution


DateTime-Calendar-Chinese

 view release on metacpan or  search on metacpan

lib/DateTime/Calendar/Chinese.pm  view on Meta::CPAN

    cycle => {
        default => 1,
    },
    cycle_year  => {
        default   => 1,
        callbacks => {
            'is between 1 and 60' => sub { $_[0] >= 1 && $_[0] <= 60 }
        }
    },
    month => {
        default   => 1,
        callbacks => {
            'is between 1 and 12' => sub { $_[0] >= 1 && $_[0] <= 12 }
        }
    },
    leap_month => {
        default => 0,

lib/DateTime/Calendar/Chinese.pm  view on Meta::CPAN

        default   => 1,
        type => Params::Validate::SCALAR()
    },
    hour   => {
        type => Params::Validate::SCALAR(), default => 0,
        callbacks => {
            'is between 0 and 23' => sub { $_[0] >= 0 && $_[0] <= 23 },
        },
    },
    minute => {
        type => Params::Validate::SCALAR(), default => 0,
        callbacks => {
            'is between 0 and 59' => sub { $_[0] >= 0 && $_[0] <= 59 },
        },
    },
    second => {
        type => Params::Validate::SCALAR(), default => 0,
        callbacks => {
            'is between 0 and 61' => sub { $_[0] >= 0 && $_[0] <= 61 },
        },
    },
    nanosecond => {
        type => Params::Validate::SCALAR(), default => 0,
        callbacks => {
            'cannot be negative' => sub { $_[0] >= 0 },
        }
    },
    locale    => { type => Params::Validate::SCALAR() | Params::Validate::OBJECT(), optional => 1 },
    language  => { type => Params::Validate::SCALAR() | Params::Validate::OBJECT(), optional => 1 },

 view all matches for this distribution


DateTime-Calendar-Discordian

 view release on metacpan or  search on metacpan

lib/DateTime/Calendar/Discordian.pm  view on Meta::CPAN


    my %args = validate(
        @arguments,
        {
            day => {
                callbacks => {
                    q{between 1 and 73 or St. Tib's Day} => sub {
                        my ( $day, $opts ) = @_;
                        if ( $day =~ $tibsday ) {
                            if ( !defined $opts->{season} ) {
                                return 1;

lib/DateTime/Calendar/Discordian.pm  view on Meta::CPAN

                    },
                },
            },
            season => {
                default   => undef,
                callbacks => {
                    'valid season name' => sub {
                        my ( $season, $opts ) = @_;
                        if ( defined $season ) {
                            return scalar grep { /((?-x)$season)/imsx }
                              keys %seasons;

 view all matches for this distribution


DateTime-Calendar-FrenchRevolutionary

 view release on metacpan or  search on metacpan

lib/DateTime/Calendar/FrenchRevolutionary.pm  view on Meta::CPAN

use DateTime::Calendar::FrenchRevolutionary::Locale;

my $BasicValidate =
    { year   => { type => SCALAR },
      month  => { type => SCALAR, default => 1,
                  callbacks =>
                  { 'is between 1 and 13' =>
                    sub { $_[0] >= 1 && $_[0] <= 13 }
                  },
                },
      day    => { type => SCALAR, default => 1,
                  callbacks =>
                  { 'is between 1 and 30' =>
                    sub { $_[0] >= 1 && $_[0] <= 30 },
                  },
                },
      hour   => { type => SCALAR, default => 0,
                  callbacks =>
                  { 'is between 0 and 9' =>
                    sub { $_[0] >= 0 && $_[0] <= 9 },
                  },
                },
      minute => { type => SCALAR, default => 0,
                  callbacks =>
                  { 'is between 0 and 99' =>
                    sub { $_[0] >= 0 && $_[0] <= 99 },
                  },
                },
      second => { type => SCALAR, default => 0,
                  callbacks =>
                  { 'is between 0 and 99' =>
                    sub { $_[0] >= 0 && $_[0] <= 99 },
                  },
                },
      abt_hour   => { type => SCALAR, default => 0,
                  callbacks =>
                  { 'is between 0 and 23' =>
                    sub { $_[0] >= 0 && $_[0] <= 23 },
                  },
                },
      abt_minute => { type => SCALAR, default => 0,
                  callbacks =>
                  { 'is between 0 and 59' =>
                    sub { $_[0] >= 0 && $_[0] <= 59 },
                  },
                },
      abt_second => { type => SCALAR, default => 0,
                  callbacks =>
                  { 'is between 0 and 61' =>
                    sub { $_[0] >= 0 && $_[0] <= 61 },
                  },
                },
      nanosecond => { type => SCALAR, default => 0,
                      callbacks =>
                      { 'cannot be negative' =>
                        sub { $_[0] >= 0 },
                      }
                    },
      locale    => { type => SCALAR | OBJECT,
                      callbacks =>
                      { "only 'fr', 'en', 'es' and 'it' possible" =>
                        sub { ($_[0] eq 'fr') or ($_[0] eq 'en')
                                              or ($_[0] eq 'es')
                                              or ($_[0] eq 'it')
                                              or ref($_[0]) =~ /(?:en|es|fr|it)$/ },

lib/DateTime/Calendar/FrenchRevolutionary.pm  view on Meta::CPAN

    };

my $NewValidate =
    { %$BasicValidate,
      time_zone => { type => SCALAR | OBJECT,
                      callbacks =>
                      { "only 'floating' possible" =>
                        sub { ($_[0] eq 'floating') or ref($_[0]) and $_[0]->is_floating },
                      },
                     default => 'floating' },
    };

 view all matches for this distribution


DateTime-Calendar-Hebrew

 view release on metacpan or  search on metacpan

Hebrew.pm  view on Meta::CPAN

sub new {
    my $class = shift;
    my %p = validate( @_,
                      { year       => { type => SCALAR },
                        month      => { type => SCALAR, default => 1,
									    callbacks => {
											'is between 1 and 13' =>
											sub { $_[0] >= 1 && $_[0] <= 13 }
									    }
									  },
                        day        => { type => SCALAR, default => 1,
									    callbacks => {
											'is between 1 and 30' =>
											sub { $_[0] >= 1 && $_[0] <= 30 }
									    }
									  },
						hour       => { type => SCALAR, default => 0,
									    callbacks => {
											'is between 0 and 23' =>
											sub { $_[0] >= 0 && $_[0] <= 23 }
									    }
									  },
						minute     => { type => SCALAR, default => 0,
									    callbacks => {
											'is between 0 and 59' =>
											sub { $_[0] >= 0 && $_[0] <= 59 }
									    }
									  },
						second     => { type => SCALAR, default => 0,
									    callbacks => {
											'is between 0 and 59' =>
											sub { $_[0] >= 0 && $_[0] <= 59 }
									    }
									  },
						nanosecond =>	{ type => SCALAR, default => 0,
									    callbacks => {
											'is between 0 and 999999999' =>
											sub { $_[0] >= 0 && $_[0] <= 999999999 }
									    }
									  },
						sunset     =>	{ type => OBJECT, optional => 1 },

Hebrew.pm  view on Meta::CPAN

sub set {
    my $self = shift;
    my %p = validate( @_,
                      { year     => { type => SCALAR, optional => 1 },
                        month    => { type => SCALAR, optional => 1,
									  callbacks => {
										'is between 1 and 13' =>
										sub { $_[0] >= 1 && $_[0] <= 13 }
									  }
									},
                        day      => { type => SCALAR, optional => 1,
									  callbacks => {
										'is between 1 and 30' =>
										sub { $_[0] >= 1 && $_[0] <= 30 }
									  }
									},
						hour     => { type => SCALAR, optional => 1,
									  callbacks => {
										'is between 0 and 23' =>
										sub { $_[0] >= 0 && $_[0] <= 23 }
									  }
									},
						minute   => { type => SCALAR, optional => 1,
									  callbacks => {
										'is between 0 and 59' =>
										sub { $_[0] >= 0 && $_[0] <= 59 }
									  }
									},
						second   => { type => SCALAR, optional => 1,
									  callbacks => {
										'is between 0 and 59' =>
										sub { $_[0] >= 0 && $_[0] <= 59 }
									  }
									},
						nanosecond =>	{ type => SCALAR, optional => 1,
									      callbacks => {
											'is between 0 and 999999999' =>
											sub { $_[0] >= 0 && $_[0] <= 999999999 }
										}
									},
						sunset =>		{ type => OBJECT, optional => 1 },

 view all matches for this distribution


( run in 2.046 seconds using v1.01-cache-2.11-cpan-7fcb06a456a )