Gantry::Plugin::Validate - Validates input values.
is_date if ( is_date( $date ) ) is_email if ( is_email( $email ) ) is_float if ( is_float( $float ) ) is_ident if ( is_ident( $ident ) ) is_integer if ( is_integer( $integer ) ) is_ip if ( is_ip( $ip ) ) is_mac if ( is_mac( $mac ) ) is_number if ( is_number( $number ) ) is_text if ( is_text( $text ) ) is_time if ( is_time( $time ) )
This module allows the validation of many common types of input.
This function takes a date, $date, and verifies that it is indeed a valid date. The date must be of the form "MM-DD-YYYY". The function returns either '1' or '0'.
$date
This function checks to see if $email is a valid email address. It checks only the form of the email address and not if the username or the domain exist. The function returns either '1' or '0'.
$email
This function checks to see if $float is a valid floating point number. The function returns either '1' or '0'.
$float
This function checks to see if $ident is a valid text ident. This means it has text, and none of the text is a space. The function returns either '1' or '0'.
$ident
This function checks to see if $integer is in fact a valid integer number. The function returns either '1' or '0'.
$integer
This function checks to see if $ip is a valid ip address. The function returns either '1' or '0'.
$ip
This function checks to see if $mac contains the valid characters for a MAC address. It does not currently check to see if the MAC address is of the proper length. The function returns either '1' or '0'.
$mac
This function checks to see if $number is a valid number. It does this by checking if it passes is_integer() or is_float(). The function returns eiter a '1' or a '0'.
$number
is_integer()
is_float()
This function checks to see if $text does contain text. This is a fairly broad range of things mainly it must be defined and have a length that is greater than 0. The function returns either a '1' or a '0'.
$text
This function checks to see if $time does contain a valid time. A valid date is in military time ( 0-23:0-59 ) seconds are optional.
$time
Gantry(3), Date::Calc(3)
This module depends on Date::Calc(3) for the is_date validation.
Tim Keefer <tkeefer@gmail.com> Nicholas Studt <nstudt@angrydwarf.org>
Copyright (c) 2005-6, Tim Keefer.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.6 or, at your option, any later version of Perl 5 you may have available.
To install Gantry, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Gantry
CPAN shell
perl -MCPAN -e shell install Gantry
For more information on module installation, please visit the detailed CPAN module installation guide.