Data::Validate::TypePublic interface encapsulating Params::Util to offer data type validation functions that pass PerlCritic | |
Download |
Data::Validate::Type Ranking & Summary
Advertisement
- License:
- Perl Artistic License
- Price:
- FREE
- Publisher Name:
- Guillaume Aubert
- Publisher web site:
- http://search.cpan.org/~aubertg/
Data::Validate::Type Tags
Data::Validate::Type Description
Params::Util is a wonderful Perl module, but suffers from a few drawbacks:- Function names start with an underscore, which is usually used to indicate private functions.- Function names are uppercase, which is usually used to indicate file handles or constants.- Function names don't pass PerlCritic's validation, making them problematic to import.- Functions use by default the convention that collection that collections need to not be empty to be valid (see _ARRAY0/_ARRAY for example), which is counter-intuitive.Those drawbacks are purely cosmetic and don't affect the usefulness of the functions, so this module encapsulates the functions to offer an API that fixes these problems.Please note that I prefer long function names that are descriptive, to arcane short ones. This increases readability, and the bulk of the typing can be spared with the use of a good IDE like Padre.Also, this is work in progress - I haven't encapsulated all the functions from Params::Util yet, and if you need one in particular feel free to contact me.SYNOPSIS # Call with explicit package name. use Data::Validate::Type; if ( Data::Validate::Type::is_string( 'test' ) ) { # ... } # Import specific functions. use Data::Validate::Type qw( is_string ); if ( is_string( 'test' ) ) { # ... } # Import functions for a given paradigm. use Data::Validate::Type qw( :boolean_tests ); if ( is_string( 'test' ) ) { # ... }Product's homepage
Data::Validate::Type Related Software