{
    "mode": "perldoc",
    "parameter": "Data::FormValidator::ConstraintsFactory",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/Data%3A%3AFormValidator%3A%3AConstraintsFactory/json",
    "generated": "2026-06-13T01:31:32Z",
    "synopsis": "use Data::FormValidator::ConstraintsFactory qw( :set :bool );\nconstraints => {\nparam1 => makeorconstraint(\nmakenumsetconstraint( -1, ( 1 .. 10 ) ),\nmakesetconstraint( 1, ( 20 .. 30 ) ),\n),\nprovince => makewordsetconstraint( 1, \"AB QC ON TN NU\" ),\nbid  => makerangeconstraint( 1, 1, 10 ),\n}",
    "sections": {
        "NAME": {
            "content": "Data::FormValidator::ConstraintsFactory - Module to create constraints for HTML::FormValidator.\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "This module contains functions to help generate complex constraints.\n\nIf you are writing new code, take a look at Data::FormValidator::Constraints::MethodsFactory\ninstead. It's a modern alternative to what's here, offering improved names and syntax.\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "use Data::FormValidator::ConstraintsFactory qw( :set :bool );\n\nconstraints => {\nparam1 => makeorconstraint(\nmakenumsetconstraint( -1, ( 1 .. 10 ) ),\nmakesetconstraint( 1, ( 20 .. 30 ) ),\n),\nprovince => makewordsetconstraint( 1, \"AB QC ON TN NU\" ),\nbid  => makerangeconstraint( 1, 1, 10 ),\n}\n",
            "subsections": []
        },
        "BOOLEAN CONSTRAINTS": {
            "content": "Those constraints are available by using the \":bool\" tag.\n\nmakenotconstraint( $c1 )\nThis will create a constraint that will return the negation of the result of constraint $c1.\n\nmakeorconstraint( @constraints )\nThis will create a constraint that will return the result of the first constraint that return an\nnon false result.\n\nmakeandconstraint( @constraints )\nThis will create a constraint that will return the result of the first constraint that return an\nnon false result only if all constraints returns a non-false results.\n",
            "subsections": []
        },
        "SET CONSTRAINTS": {
            "content": "Those constraints are available by using the \":set\" tag.\n\nmakesetconstraint( $res, @elements )\nThis will create a constraint that will return $res if the value is one of the @elements set, or\nthe negation of $res otherwise.\n\nThe \"eq\" operator is used for comparison.\n\nmakenumsetconstraint( $res, @elements )\nThis will create a constraint that will return $res if the value is one of the @elements set, or\nthe negation of $res otherwise.\n\nThe \"==\" operator is used for comparison.\n\nmakewordsetconstraint( $res, $set )\nThis will create a constraint that will return $res if the value is a word in $set, or the\nnegation of $res otherwise.\n\nmakecmpsetconstraint( $res, $cmp, @elements )\nThis will create a constraint that will return $res if the value is one of the @elements set, or\nthe negation of $res otherwise.\n\n$cmp is a function which takes two argument and should return true or false depending if the two\nelements are equal.\n",
            "subsections": []
        },
        "NUMERICAL LOGICAL CONSTRAINTS": {
            "content": "Those constraints are available by using the \":num\" tag.\n\nmakeclampconstraint( $res, $low, $high )\nThis will create a constraint that will return $res if the value is between $low and $high\nbounds included or its negation otherwise.\n\nmakeltconstraint( $res, $bound )\nThis will create a constraint that will return $res if the value is lower than $bound, or the\nnegation of $res otherwise.\n\nmakeleconstraint( $res, $bound )\nThis will create a constraint that will return $res if the value is lower or equal than $bound,\nor the negation of $res otherwise.\n\nmakegtconstraint( $res, $bound )\nThis will create a constraint that will return $res if the value is greater than $bound, or the\nnegation of $res otherwise.\n\nmakegeconstraint( $res, $bound )\nThis will create a constraint that will return $res if the value is greater or equal than\n$bound, or the negation of $res otherwise.\n",
            "subsections": []
        },
        "OTHER CONSTRAINTS": {
            "content": "makelengthconstraint($maxlength)\nThis will create a constraint that will return true if the value has a length of less than or\nequal to $maxlength\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "Data::FormValidator(3)\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Author: Francis J. Lacoste <francis.lacoste@iNsu.COM> Maintainer: Mark Stosberg\n<mark@summersault.com>\n",
            "subsections": []
        },
        "COPYRIGHT": {
            "content": "Copyright (c) 2000 iNsu Innovations Inc. All rights reserved.\n\nThis program is free software; you can redistribute it and/or modify it under the terms as perl\nitself.\n",
            "subsections": []
        }
    },
    "summary": "Data::FormValidator::ConstraintsFactory - Module to create constraints for HTML::FormValidator.",
    "flags": [],
    "examples": [],
    "see_also": [
        {
            "name": "FormValidator",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/FormValidator/3/json"
        }
    ]
}