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

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

Serving Software Downloads in 976 Categories, Downloaded 29.547.166 Times

Params::Validate 0.88

  Date Added: January 04, 2010  |  Visits: 612

Params::Validate

Report Broken Link
Printer Friendly Version


Product Homepage
Download (86 downloads)



Params::Validate is a Perl module to validate method/function parameters. SYNOPSIS use Params::Validate qw(:all); # takes named params (hash or hashref) sub foo { validate( @_, { foo => 1, # mandatory bar => 0, # optional } ); } # takes positional params sub bar { # first two are mandatory, third is optional validate_pos( @_, 1, 1, 0 ); } sub foo2 { validate( @_, { foo => # specify a type { type => ARRAYREF }, bar => # specify an interface { can => [ print, flush, frobnicate ] }, baz => { type => SCALAR, # a scalar ... # ... that is a plain integer ... regex => qr/^d+$/, callbacks => { # ... and smaller than 90 less than 90 => sub { shift() < 90 }, }, } } ); } sub with_defaults { my %p = validate( @_, { foo => 1, # required # $p{bar} will be 99 if bar is not # given. bar is now optional. bar => { default => 99 } } ); } sub pos_with_defaults { my @p = validate_pos( @_, 1, { default => 99 } ); } sub sets_options_on_call { my %p = validate_with ( params => @_, spec => { foo => { type SCALAR, default => 2 } }, normalize_keys => sub { $_[0] =~ s/^-//; lc $_[0] }, ); } The Params::Validate module allows you to validate method or function call parameters to an arbitrary level of specificity. At the simplest level, it is capable of validating the required parameters were given and that no unspecified additional parameters were passed in. It is also capable of determining that a parameter is of a specific type, that it is an object of a certain class hierarchy, that it possesses certain methods, or applying validation callbacks to arguments..

Requirements: No special requirements
Platforms: Linux
Keyword: Bar Foo Libraries Module Paramsvalidate Perl Module Programming Sub Type Validate
Users rating: 0/10

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


PARAMS::VALIDATE RELATED
Libraries  -  Alien Perl module 0.91
Alien Perl module package contains external libraries wrapped up for your viewing pleasure! SYNOPSIS perldoc Alien; Alien is a package that exists just to hold together an idea, the idea of Alien:: packages, so there is no code here, just...
10.24 KB  
Libraries  -  Video::Info::FOO 0.993
Video::Info::FOO is a Perl module for video information. Video::Info::FOO - what is it useful for? an example list: -video codec -audio codec -frame height -frame width -frame count and more! SYNOPSIS use Video::Info::FOO; my...
634.88 KB  
Libraries  -  OpenGeoDB Perl module 0.4
OpenGeDB Perl module is a module to access the OpenGeoDB database and calculate all ZIP codes in a certain radius..
3.07 KB  
Libraries  -  Module::Signature 0.55
Module::Signature is a Perl module signature file manipulation. SYNOPSIS As a shell command: % cpansign # verify an existing SIGNATURE, or # make a new one if none exists % cpansign sign # make signature; overwrites existing one %...
68.61 KB  
Libraries  -  Class::Tangram 1.57
Class::Tangram is a Perl module for tangram-friendly classes, DWIM attributes. SYNOPSIS package MyObject; use base qw(Class::Tangram); our $fields = { int => [ qw(foo bar) ], string => [ qw(baz quux) ] }; package main; my $object =...
50.18 KB  
Libraries  -  Myco::Devel 1.22
Myco::Devel is a Perl module for myco Developers Guide. This guide is intended for developers wanting to build applications with myco. You should have a decent grasp of the Perl programming language, or else a solid grasp of another programming...
102.4 KB  
Network & Internet  -  MyCMS perl module 1.0
MyCMS perl module provides the MN::CMS Perl module used by the MyCMS. MyCMS perl module contains Perl object classes to manage the data of MyCMS (such as articles, links, and images). MN::CMS is a perl module that allows you to manage an...
16.38 KB  
Libraries  -  Sys::PortIO 0.1
Sys::PortIO is a Perl module to perform direct port I/O from Perl. SYNOPSIS use Sys::PortIO; port_open($portnum); write_byte($portnum, $value); $value = read_byte($portnum); port_close($portnum); This module provides a Perl interface to...
737.28 KB  
Libraries  -  XML::Literal 0.02
XML::Literal is a Perl module with syntax support for XML literals. SYNOPSIS # This is not a source filter: it just augments glob(). use XML::Simple; use XML::Literal &XMLin; # Simple element my $xml1 = ; # With variable...
24.58 KB  
Libraries  -  Samba::LDAP 0.03
Samba::LDAP is a Perl module to manage a Samba PDC with an LDAP Backend. SYNOPSIS use Carp; use Samba::LDAP; my $samba = Samba::LDAP->new() or croak "Cant create objectn"; my $domain = $samba->get_local_sid();.
81.92 KB  
NEW DOWNLOADS IN PROGRAMMING, LIBRARIES
Programming  -  FLEX-db Digital Asset Manager 3.0.9
FLEX-db - an enterprise Digital Asset Manager (DAM). It ingests and links metadata with files, creates thumbnails, and processes files using business rules. FLEX-db has a JSP client, Java app server for file input and output and an EJB metadata...
21.57 MB  
Programming  -  Libicom 0.9.0
The libicom library is a character based dynamicly linked library for Linux. It is used to remotely control the Icom IC-R8500 wide band receiver via an RS232 link. All call and return parameters to the control functions are character string based....
20.48 KB  
Programming  -  dotdesktop 0.3
Dotdesktop library provides ability to parse desktop entry file and access the information in a convenient way. Desktop entry file format is defined by freedesktop.org, it is used to describe information about an application such as the name and...
327.68 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  -  libyasl 0.2
Libyasl is a C++ class library to easily realize TCP/UDP/Multicast clientsand servers in IPv4 and IPv6 environments under GNU/Linux systems.
143.36 KB  
Libraries  -  EuGTK 4.8.9
Makes it easy to develop good- looking, fast, cross-platform programs that run on Linux, OS X, and Windows. Euphoria is a very fast interpreted/compiled language with straight-forward syntax. EuGTK allows programming in a clean, object-oriented...
10.68 MB  
Libraries  -  Linux User Group Library Manager 1.0
The LUG Library Manager is a project to help Linux User Groups start their own library. A LUG library is helpful to the community at large because it increases access to information, and gives everyone the opportunity to become more knowledgeable.
5.35 KB  
Libraries  -  Module::MakefilePL::Parse 0.12
Module::MakefilePL::Parse is a Perl module to parse required modules from Makefile.PL. SYNOPSIS use Module::MakefilePL::Parse; open $fh, Makefile.PL; $parser = Module::MakefilePL::Parse->new( join("", ) ); $info = $parser->required;...
8.19 KB  
Libraries  -  sqlpp 0.06
sqlpp Perl package is a SQL preprocessor. sqlpp is a conventional cpp-alike preprocessor taught to understand SQL ( PgSQL, in particular) syntax specificities. In addition to the standard #define/#ifdef/#else/#endif cohort, provides also...
10.24 KB  
Libraries  -  App::SimpleScan::Substitution::Line 2.02
App::SimpleScan::Substitution::Line is a line with optional fixed variable values. SYNOPSIS my $line = App::SimpleScan::Substitution::Line->new(" this "); # Use only this value when substituting " ". $line->fix(substituite =>...
54.27 KB