GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Declare::Constraints::Simple::Library::Array(3) User Contributed Perl Documentation Declare::Constraints::Simple::Library::Array(3)

Declare::Constraints::Simple::Library::Array - Array Constraints

  # accept a list of pairs
  my $pairs_validation = IsArrayRef( HasArraySize(2,2) );

  # integer => object pairs
  my $pairs = And( OnEvenElements(IsInt), 
                   OnOddElements(IsObject) );

  # a three element array
  my $tri = And( HasArraySize(3,3),
                 OnArrayElements(0, IsInt,
                                 1, IsDefined,
                                 2, IsClass) );

This module contains all constraints that can be applied to array references.

With $min defaulting to 1. So a specification of

  my $profile = HasArraySize;

checks for at least one value. To force an exact size of the array, specify the same values for both:

  my $profile = HasArraySize(3, 3);

Applies the the $constraints to the corresponding $keys if they are present. For required keys see "HasArraySize".

Runs the constraint on all even elements of an array. See also "OnOddElements".

Runs the constraint on all odd elements of an array. See also "OnEvenElements".

Declare::Constraints::Simple, Declare::Constraints::Simple::Library

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

This module is free software, you can redistribute it and/or modify it under the same terms as perl itself.
2006-09-14 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.