Valida...xDigits(3pm)

πŸ“¦
version 7.900059 Β· 7 versions
, in debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– Validation::Class::Directive::MaxDigits πŸ’–

okay so bestie, welcome to the Validation::Class::Directive::MaxDigits page β€” it's a directive for Validation Class Field Definitions, from the Validation::Class::Directive::MaxDigits fam, and it lives in the User Contributed Perl Documentation section of the manual (section 3pm, iykyk). let's get into it ✨


🌸 VERSION 🌸

version 7.900059 β€” that's the vibe, no cap 🫢


πŸŽ€ SYNOPSIS πŸŽ€

here's how you actually use it, bestie:

use Validation::Class::Simple;

my $rules = Validation::Class::Simple->new(
    fields => {
        password => {
            max_digits => 12
        }
    }
);

# set parameters to be validated
$rules->params->add($parameters);

# validate
unless ($rules->validate) {
    # handle the failures
}

so you spin up a Validation::Class::Simple object, declare your fields, and give password a max_digits => 12. then you shove your $parameters into $rules->params->add(...), and hit $rules->validate β€” and if it comes back false, that unless block is your moment to deal with the failures πŸ˜­πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

Validation::Class::Directive::MaxDigits is a core validation class field directive that validates the length of numeric characters in the associated parameters. that's it, that's the whole job β€” it's giving "how many digits max, bestie" and it is not playing around πŸ”₯

so like, if you said max_digits => 12, then the numeric characters in your parameter better be 12 or fewer. periodt. πŸ‘‘


πŸ‘‘ AUTHOR πŸ‘‘

Al Newkirk <anewkirk@ana.io> β€” the icon, the legend ⭐


This software is copyright (c) 2011 by Al Newkirk.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. so like, go off, remix it, whatever β€” just keep the terms, fr fr πŸ’–


aaaand that's the whole page, bestie 🫢 this was perl v5.36.0, dated 2023-06-11, brought to you by the User Contributed Perl Documentation crew. mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from