Data::Schema::Type::Int - Type handler for integer numbers ('int')
version 0.136
use Data::Schema;
This is the type handler for type 'int'.
See Data::Schema::Type::Num.
In addition to those provided by Num, ints have additional attributes.
Require that (data mod X) equals Y. For example, mod => [2, 1] effectively specifies odd numbers.
Require that data is divisible by all specified numbers.
Example:
ds_validate( 4, [int=>{divisible_by=>2}] ); # valid ds_validate( 4, [int=>{divisible_by=>[2,3]}] ); # invalid ds_validate( 6, [int=>{divisible_by=>[2,3]}] ); # valid
Aliases: indivisible_by
Opposite of divisible_by.
Steven Haryanto <stevenharyanto@gmail.com>
This software is copyright (c) 2009 by Steven Haryanto.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Data::Schema, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Data::Schema
CPAN shell
perl -MCPAN -e shell install Data::Schema
For more information on module installation, please visit the detailed CPAN module installation guide.