Valida...Length(3pm)
β¨ Validation::Class::Directive::Length β the manual page but make it a group chat β¨
okay bestie so this is Validation::Class::Directive::Length, a Perl module, from the Validation::Class family, sitting in the 3pm manual section (that's Perl Module Pages, iykyk). It's the Length directive β the one that does a vibe check on how long your stuff is. π
π VERSION
version 7.900059
that's the version, no cap. write it down. π
π SYNOPSIS
here's how you actually use it, bestie β copy this exactly:
use Validation::Class::Simple;
my $rules = Validation::Class::Simple->new(
fields => {
security_pin => {
length => 4
}
}
);
# set parameters to be validated
$rules->params->add($parameters);
# validate
unless ($rules->validate) {
# handle the failures
}
so you're building a rules object, you're declaring a field called security_pin with length => 4, you're feeding it your $parameters, and then you call $rules->validate β and if it comes back false, that's your cue to handle the failures. simple. iconic. π«Ά
π DESCRIPTION
Validation::Class::Directive::Length is a core validation class field directive that validates the exact length of the associated parameters.
exact. length. not "roughly", not "vibes-based", exact. if you said 4, it wants 4. periodt. π
π AUTHOR
Al Newkirk <anewkirk@ana.io> β the author, the legend, the main character of this module. π
πΈ COPYRIGHT AND LICENSE
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.
fr fr, that's the whole license. free software, same terms as Perl 5 itself, go wild (respectfully). π§
and that's the page!! this was built for perl v5.36.0 and the page is dated 2023-06-11 β shoutout to the good folks who contributed it to the Perl documentation. bye bestie, go validate something exact πβ¨
π¦ where this page comes from
- debian trixie: libvalidation-class-perl 7.900059-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libvalidation-class-perl 7.900059-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libvalidation-class-perl 7.900059-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libvalidation-class-perl 7.900059-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms