Declare::Constraints::Simple::Library::Referencial man page on Fedora

Man page or keyword search:  
man Server   31170 pages
apropos Keyword Search (all sections)
Output format
Fedora logo
[printable version]

Declare::Constraints::UseDeclare::Constraints::Simple::Library::Referencial(3)

NAME
       Declare::Constraints::Simple::Library::Referencial - Ref Constraints

SYNOPSIS
	 # scalar or array references
	 my $scalar_or_array = IsRefType( qw(SCALAR ARRAY) );

	 # scalar reference
	 my $int_ref = IsScalarRef( IsInt );

	 # accept mappings of ids to objects with "name" methods
	 my $id_obj_map =
	   IsHashRef( -keys   => IsInt,
		      -values => And( IsObject,
				      HasMethods('name') ));

	 # an integer list
	 my $int_list = IsArrayRef( IsInt );

	 # accept code references
	 my $is_closure = IsCodeRef;

	 # accept a regular expression
	 my $is_regex = IsRegex;

DESCRIPTION
       This library contains those constraints that can test the validity of
       references and their types.

CONSTRAINTS
   IsRefType(@types)
       Valid if the value is a reference of a kind in @types.

   IsScalarRef($constraint)
       This is true if the value is a scalar reference. A possible constraint
       for the scalar references target value can be passed. E.g.

	 my $test_integer_ref = IsScalarRef(IsInt);

   IsArrayRef($constraint)
       The value is valid if the value is an array reference. The contents of
       the array can be validated by passing an other $constraint as argument.

       The stack or path part of "IsArrayRef" is "IsArrayRef[$index]" where
       $index is the index of the failing element.

   IsHashRef(-keys => $constraint, -values => $constraint)
       True if the value is a hash reference. It can also take two named
       parameters: "-keys" can pass a constraint to check the hashes keys,
       "-values" does the same for its values.

       The stack or path part of "IsHashRef" looks like "IsHashRef[$type
       $key]" where $type is either "val" or "key" depending on what was
       validated, and $key being the key that didn't pass validation.

   IsCodeRef()
       Code references have to be valid to pass this constraint.

   IsRegex()
       True if the value is a regular expression built with "qr". Note
       however, that a simple string that could be used like "/$rx/" will not
       pass this constraint. You can combine multiple constraints with
       And(@constraints) though.

SEE ALSO
       Declare::Constraints::Simple, Declare::Constraints::Simple::Library

AUTHOR
       Robert 'phaylon' Sedlacek "<phaylon@dunkelheit.at>"

LICENSE AND COPYRIGHT
       This module is free software, you can redistribute it and/or modify it
       under the same terms as perl itself.

perl v5.14.1		 Declare::Constraints::Simple::Library::Referencial(3)
[top]

List of man pages available for Fedora

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net