Valida...Length(3pm)

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

✨ 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. πŸ’œ


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