Params::Check::Faster

A generic input parsing/checking mechanism. Reimplementation of Params::Check
Download

Params::Check::Faster Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Damien Krotkine
  • Publisher web site:
  • http://search.cpan.org/~dams/

Params::Check::Faster Tags


Params::Check::Faster Description

A generic input parsing/checking mechanism. Reimplementation of Params::Check Params::Check::Faster is a Perl module, a generic input parsing/checking mechanism.This module is a faster reimplementation of Params::Check. It should be 100% compatible. It might be merged with Params::Check at some point, after its author (kane) has reviewed it and is happy with merging it.It allows you to validate input via a template. The only requirement is that the arguments must be named.Params::Check::Faster can do the following things for you: * Convert all keys to lowercase * Check if all required arguments have been provided * Set arguments that have not been provided to the default * Weed out arguments that are not supported and warn about them to the user * Validate the arguments given by the user based on strings, regexes, lists or even subroutines * Enforce type integrity if requiredSYNOPSIS use Params::Check::Faster qw; sub fill_personal_info { my %hash = @_; my $x; my $tmpl = { firstname => { required => 1, defined => 1 }, lastname => { required => 1, store => \$x }, gender => { required => 1, allow => , }, married => { allow => }, age => { default => 21, allow => qr/^\d+$/, }, phone => { allow => }, id_list => { default => [], strict_type => 1 }, employer => { default => 'NSA', no_override => 1 }, }; ### check() returns a hashref of parsed args on success ### my $parsed_args = check( $tmpl, \%hash, $VERBOSE ) or die qw; ... other code here ... } my $ok = allow( $colour, ); my $error = Params::Check::Faster::last_error(); Requirements: · Perl


Params::Check::Faster Related Software