Download Shareware and Freeware Software for Windows, Linux, Macintosh, PDA

line Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

Serving Software Downloads in 956 Categories, Downloaded 50.363.267 Times

Data::Validate 0.08

Company: Richard Sonnen
Date Added: October 08, 2013  |  Visits: 377

Data::Validate

Report Broken Link
Printer Friendly Version


Product Homepage
Download (37 downloads)



This module collects common validation routines to make input validation, and untainting easier and more readable. Most of the functions are not much shorter than their direct perl equivalent (and are much longer in some cases), but their names make it clear what you're trying to test for.<br /><br />Almost all functions return an untainted value if the test passes, and undef if it fails. This means that you should always check for a defined status explicitly. Don't assume the return will be true. (e.g. is_integer(0))<br /><br />The value to test is always the first (and often only) argument.<br />FUNCTIONS ^<br /><br /> new - constructor for OO usage<br /><br /> new();<br /><br /> Description<br /><br /> Returns a Data::Validator object. This lets you access all the validator function calls as methods without importing them into your namespace or using the clumsy Data::Validate::function_name() format.<br /> Arguments<br /><br /> None<br /> Returns<br /><br /> Returns a Data::Validate object<br /><br /> is_integer - is the value an integer?<br /><br /> is_integer($value);<br /><br /> Description<br /><br /> Returns the untainted number if the test value is an integer, or can be cast to one without a loss of precision. (i.e. 1.0 is considered an integer, but 1.0001 is not.)<br /> Arguments<br /><br /> $value<br /><br /> The potential integer to test.<br /><br /> Returns<br /><br /> Returns the untainted integer on success, undef on failure. Note that the return can be 0, so always check with defined()<br /> Notes, Exceptions, & Bugs<br /><br /> Number translation is done by POSIX casting tools (strtol).<br /><br /> is_numeric - is the value numeric?<br /><br /> is_numeric($value);<br /><br /> Description<br /><br /> Returns the untainted number if the test value is numeric according to Perl's own internal rules. (actually a wrapper on Scalar::Util::looks_like_number)<br /> Arguments<br /><br /> $value<br /><br /> The potential number to test.<br /><br /> Returns<br /><br /> Returns the untainted number on success, undef on failure. Note that the return can be 0, so always check with defined()<br /> Notes, Exceptions, & Bugs<br /><br /> Number translation is done by POSIX casting tools (strtol).<br /><br /> is_hex - is the value a hex number?<br /><br /> is_hex($value);<br /><br /> Description<br /><br /> Returns the untainted number if the test value is a hex number.<br /> Arguments<br /><br /> $value<br /><br /> The potential number to test.<br /><br /> Returns<br /><br /> Returns the untainted number on success, undef on failure. Note that the return can be 0, so always check with defined()<br /> Notes, Exceptions, & Bugs<br /><br /> None<br /><br /> is_oct - is the value an octal number?<br /><br /> is_oct($value);<br /><br /> Description<br /><br /> Returns the untainted number if the test value is a octal number.<br /> Arguments<br /><br /> $value<br /><br /> The potential number to test.<br /><br /> Returns<br /><br /> Returns the untainted number on success, undef on failure. Note that the return can be 0, so always check with defined()<br /> Notes, Exceptions, & Bugs<br /><br /> None<br /><br /> is_between - is the value between two numbers?<br /><br /> is_between($value, $min, $max);<br /><br /> Description<br /><br /> Returns the untainted number if the test value is numeric, and falls between $min and $max inclusive. Note that either $min or $max can be undef, which means 'unlimited'. i.e. is_between($val, 0, undef) would pass for any number zero or larger.<br /> Arguments<br /><br /> $value<br /><br /> The potential number to test.<br /> $min<br /><br /> The minimum valid value. Unlimited if set to undef<br /> $max<br /><br /> The maximum valid value. Unlimited if set to undef<br /><br /> Returns<br /><br /> Returns the untainted number on success, undef on failure. Note that the return can be 0, so always check with defined()<br /><br /> is_greater_than - is the value greater than a threshold?<br /><br /> is_greater_than($value, $threshold);<br /><br /> Description<br /><br /> Returns the untainted number if the test value is numeric, and is greater than $threshold. (not inclusive)<br /> Arguments<br /><br /> $value<br /><br /> The potential number to test.<br /> $threshold<br /><br /> The minimum value (non-inclusive)<br /><br /> Returns<br /><br /> Returns the untainted number on success, undef on failure. Note that the return can be 0, so always check with defined()<br /><br /> is_less_than - is the value less than a threshold?<br /><br /> is_less_than($value, $threshold);<br /><br /> Description<br /><br /> Returns the untainted number if the test value is numeric, and is less than $threshold. (not inclusive)<br /> Arguments<br /><br /> $value<br /><br /> The potential number to test.<br /> $threshold<br /><br /> The maximum value (non-inclusive)<br /><br /> Returns<br /><br /> Returns the untainted number on success, undef on failure. Note that the return can be 0, so always check with defined()<br /><br /> is_equal_to - do a string/number neutral ==<br /><br /> is_equal_to($value, $target);<br /><br /> Description<br /><br /> Returns the target if $value is equal to it. Does a math comparison if both $value and $target are numeric, or a string comparison otherwise. Both the $value and $target must be defined to get a true return. (i.e. undef != undef)<br /> Arguments<br /><br /> $value<br /><br /> The value to test.<br /> $target<br /><br /> The value to test against<br /><br /> Returns<br /><br /> Unlike most validator routines, this one does not necessarily untaint its return value, it just returns $target. This has the effect of untainting if the target is a constant or other clean value. (i.e. is_equal_to($bar, 'foo')). Note that the return can be 0, so always check with defined()<br /><br /> is_even - is a number even?<br /><br /> is_even($value);<br /><br /> Description<br /><br /> Returns the untainted $value if it's numeric, an integer, and even.<br /> Arguments<br /><br /> $value<br /><br /> The value to test.<br /><br /> Returns<br /><br /> Returns $value (untainted). Note that the return can be 0, so always check with defined().<br /><br /> is_odd - is a number odd?<br /><br /> is_odd($value);<br /><br /> Description<br /><br /> Returns the untainted $value if it's numeric, an integer, and odd.<br /> Arguments<br /><br /> $value<br /><br /> The value to test.<br /><br /> Returns<br /><br /> Returns $value (untainted). Note that the return can be 0, so always check with defined().<br /><br /> is_alphanumeric - does it only contain letters and numbers?<br /><br /> is_alphanumeric($value);<br /><br /> Description<br /><br /> Returns the untainted $value if it is defined and only contains letters (upper or lower case) and numbers. Also allows an empty string - ''.<br /> Arguments<br /><br /> $value<br /><br /> The value to test.<br /><br /> Returns<br /><br /> Returns $value (untainted). Note that the return can be 0, so always check with defined().<br /><br /> is_printable - does it only contain printable characters?<br /><br /> is_alphanumeric($value);<br /><br /> Description<br /><br /> Returns the untainted $value if it is defined and only contains printable characters as defined by the composite POSIX character class [[:print:][:space:]]. Also allows an empty string - ''.<br /> Arguments<br /><br /> $value<br /><br /> The value to test.<br /><br /> Returns<br /><br /> Returns $value (untainted). Note that the return can be 0, so always check with defined().<br /><br /> length_is_between - is the string length between two limits?<br /><br /> length_is_between($value, $min, $max);<br /><br /> Description<br /><br /> Returns $value if it is defined and its length is between $min and $max inclusive. Note that this function does not untaint the value.<br /><br /> If either $min or $max are undefined they are treated as no-limit.<br /> Arguments<br /><br /> $value<br /><br /> The value to test.<br /> $min<br /><br /> The minimum length of the string (inclusive).<br /> $max<br /><br /> The maximum length of the string (inclusive).<br /><br /> Returns<br /><br /> Returns $value. Note that the return can be 0, so always check with defined(). The value is not automatically untainted.

Requirements: No special requirements
Platforms: *nix, Linux
Keyword: Arguments Check Defined Description Failure Inclusive Integer Number Numeric Potential Return Returns String Success Target Threshold Undef Untainted
Users rating: 0/10

License: Freeware Size: 10.24 KB
USER REVIEWS
More Reviews or Write Review


DATA::VALIDATE RELATED
Mathematics  -  Prime Number Finder 1.0
Lists all Prime Numbers, also allows you to enter a number and check if it is a prime number. If not - it will show all factors of the number.
1024 KB  
Database Tools  -  dbff 1.0
dbff can be used to read and write flat file databases in a tagged CSV format. It can serve as a standalone PHP database replacement for simple and small applications or dynamic web pages. It can create and maintain files with a given data...
30.72 KB  
Networking  -  WP-EasyArchives 1.5.2
Display your archive tree that's search engine friendly on custom page, Widgets is supported.Supported Languages: * US English/en_US (default) * dET«ded+duOCtd+DLTsdAOCoOCi/zh_CN (translate by mg12) * Albanian/sq_AL (translate by Romeo Shuka) *...
10 KB  
Libraries  -  Nagios::WebTransact::Timed 0.06
Nagios::WebTransact::Timed is an object that provides a check method (usually called by a Nagios service check) to determine if a sequence of URLs can be got inside a time threshold, returning the times for each. SYNOPSIS use...
8.19 KB  
Utilities  -  Drag and Drop Robot 1.08.00
Drag and Drop Shell Robot is a utility to help power users easily peform operations on large numbers of files and folders.You can create any number of configuration files by specifying a target application and various commandline parameters or...
1.24 MB  
Scientific and Engineering  -  RGB Color Management 1.0
It can take as an input a color index (number from 1 to 21), string (name of the color, English name) and RGB triple with elements in [0,255]. Some colors have more than one name, in which case any of these may be used. See the code for the list...
 
Miscellaneous  -  Getting th permutation of a sequence 1.1
This script contains a function that given a sequence and a number n as parameters, returns the th permutation of the sequence (always as a list).
 
Libraries  -  Math::Numbers 0.000000001
Math::Numbers is a Perl module that contains methods for mathematical approaches of concepts of the number theory. SYNOPSIS use Math::Numbers; my $a = 123; my $b = 34; my $numbers = Math::Numbers->new($a, $b [, ...]); print "They are...
4.1 KB  
Multimedia & Graphics  -  An Integer Conversion Application for Noobs New
An Integer Conversion Application for Noobs was designed using the Java programming language to help you convert numbers to different numbering systems. All you have to do is input the integer number you want converted, select the base system and...
 
Libraries  -  Gtk 0.7009
Gtk enums, flags, object types, arguments and signals. Gnome::AppBar (Gtk::HBox) Signals undef clear-prompt (Gnome::AppBar) undef user-response (Gnome::AppBar) Gnome::AppletWidget (Gtk::Plug) Signals undef back-change...
440.32 KB  
NEW DOWNLOADS IN LINUX SOFTWARE, PROGRAMMING
Linux Software  -  EasyEDA PCB Designer for Linux 2.0.0
EasyEDA, a great web based EDA(Electronics Design Automation) tool, online PCB tool, online PCB software for electronics engineers, educators, students, makers and enthusiasts. Theres no need to install any software. Just open EasyEDA in any...
34.4 MB  
Linux Software  -  wpCache® WordPress HTTP Cache 1.9
wpCache® is a high-performance, distributed object, caching system application, generic in nature, but intended for use in speeding up dynamic web applications, by decreasing database load time. wpCache® decreases dramatically the page...
3.51 MB  
Linux Software  -  Polling Autodialer Software 3.4
ICTBroadcast Auto Dialer software has a survey campaign for telephone surveys and polls. This auto dialer software automatically dials a list of numbers and asks them a set of questions that they can respond to, by using their telephone keypad....
488 B  
Linux Software  -  Total Video Converter Mac Free 3.5.5
Total Video Converter Mac Free developed by EffectMatrix Ltd is the official legal version of Total Video Converter which was a globally recognized brand since 2006. Total Video Converter Mac Free is a free but powerful all-in-one video...
17.7 MB  
Linux Software  -  Skeith mod_log_sql Analyzer 2.10beta2
Skeith is a php based front end for analyzing logs for Apache using mod_log_sql.
47.5 KB  
Programming  -  Cedalion for Linux 0.2.6
Cedalion is a programming language that allows its users to add new abstractions and define (and use) internal DSLs. Its innovation is in the fact that it uses projectional editing to allow the new abstractions to have no syntactic limitations.
471.04 KB  
Programming  -  Math::GMPf 0.29
Math::GMPf - perl interface to the GMP library's floating point (mpf) functions.
30.72 KB  
Programming  -  Net::Wire10 1.08
Net::Wire10 is a Pure Perl connector that talks to Sphinx, MySQL and Drizzle servers. Net::Wire10 implements the low-level network protocol, alias the MySQL wire protocol version 10, necessary for talking to one of the aforementioned...
30.72 KB  
Programming  -  logilab-common 0.56.2
a bunch of modules providing low level functionnalities shared among some python projects devel Please note that some of the modules have some extra dependencies. For instance, logilab.common.db will require a db-api 2.0 compliant...
174.08 KB  
Programming  -  OpenSSL for linux 1.0.0a
The OpenSSL Project is a collaborative effort to develop a robust, commercial-grade, full-featured, and Open Source toolkit implementing the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) protocols as well as a...
3.83 MB