The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Params::Validate::Checks::Integer - Params::Validate checks for functions taking integer arguments

VERSION

version 0.01

SYNOPSIS

  use Params::Validate::Checks qw<validate as>;
  use Params::Validate::Checks::Integer;

  sub league_table_row
  {
    my %arg = validate @_,
    {
      position     => { as 'pos_int' }, #From P::V::Checks
      games_played => { as 'non-neg-int' },
      points       => { as 'integer' }, #Allow for points deducted!
      goal_difference
                   => { as 'integer' },
    };

    # Do something with this league table position.
  }

DESCRIPTION

This is a library of named checks for use with Params::Validate to validate all integers and those that should be non-negative. See Params::Validate::Checks for in-built validation of positive (non-zero) integers.

Checks

The following named checks are supplied by this module.

integer

an integer value, which can be positive, negative or zero.

non-neg-int

an integer value, which can be positive or zero.

NAME

Params::Validate::Checks::Integer - Params::Validate checks for functions taking integer arguments.

SEE ALSO

CREDITS

Smylers <smylers@cpan.org> for Params::Validate::Checks.

chocolateboy <chocolate@cpan.org> for Scalar::Util::Numeric

AUTHOR

Stephen Cardie <stephenca@cpan.org>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2011 by Stephen Cardie.

This is free software, licensed under:

  The Artistic License 2.0 (GPL Compatible)