Declare::Constraints::Simple::Library::Scalar man page on Pidora

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

Declare::Constraints::UserlConDeclare::Constraints::Simple::Library::Scalar(3)

NAME
       Declare::Constraints::Simple::Library::Scalar - Scalar Constraints

SYNOPSIS
	 # match one of a set of regexes
	 my $some_regexes = Matches(qr/foo/, qr/bar/);

	 # allow only defined values
	 my $is_defined = IsDefined;

	 # between 5 and 50 chars
	 my $five_to_fifty = HasLength(5, 50);

	 # match against a set of values
	 my $command_constraint = IsOneOf(qw(create update delete));

	 # check for trueness
	 my $is_true = IsTrue;

	 # simple equality
	 my $is_foo = IsEq('foo');

DESCRIPTION
       This library contains all constraints to validate scalar values.

CONSTRAINTS
   Matches(@regex)
	 my $c = Matches(qr/foo/, qr/bar/);

       If one of the parameters matches the expression, this is true.

   IsDefined()
       True if the value is defined.

   HasLength([$min, [$max]])
       Is true if the value has a length above $min (which defaults to 1> and,
       if supplied, under the value of $max. A simple

	 my $c = HasLength;

       checks if the value has a length of at least 1.

   IsOneOf(@values)
       True if one of the @values equals the passed value. "undef" values work
       with this too, so

	 my $c = IsOneOf(1, 2, undef);

       will return true on an undefined value.

   IsTrue()
       True if the value evulates to true in boolean context.

   IsEq($comparator)
       Valid if the value is "eq" the $comparator.

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::Scalar(3)
[top]

List of man pages available for Pidora

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