Valida...Matches(3pm)

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

✨ NAME ✨

ok so bestie, welcome to Validation::Class::Directive::Matches β€” the Matches Directive for Validation Class Field Definitions πŸ’– this is the little guy that makes sure two fields actually match each other (yes, we're talking password confirmation vibes πŸŽ€)


🌸 VERSION 🌸

version 7.900059 (iykyk)


πŸ¦‹ SYNOPSIS πŸ¦‹

here's the whole vibe, copy-paste ready no cap:

use Validation::Class::Simple;

my $rules = Validation::Class::Simple->new(
    fields => {
        password => {
            matches => 'password2'
        }
    }
);

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

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

so you make your rules, you hand over your $parameters with params->add, then you hit validate β€” and if it comes back false, you gotta deal with the failures yourself. periodt. πŸ’…


πŸ’– DESCRIPTION πŸ’–

Validation::Class::Directive::Matches is a core validation class field directive that validates whether the value of the dependent parameters matches that of the associated field. 🫢

basically: it checks the dependent params against the field they're associated with, and if they don't line up, that's a fail, bestie. it's giving matching-set energy. ✨

πŸŽ€ alternative argument: an-array-of-parameter-names πŸŽ€

ok so this directive can be passed a single value OR an array of values β€” your choice, main character:

fields => {
    password => {
        matches => ['password2', 'password3']
    }
}

one param or a whole squad, it handles it either way 🌈


πŸ‘‘ AUTHOR πŸ‘‘

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


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, it's free software β€” same terms as Perl 5 itself, go wild (respectfully) πŸ’œ

okay that's the whole page bestie, no notes πŸ’… this gorgeous little manpage was served up by perl v5.36.0, dated 2023-06-11, and it belongs to Valida...Matches(3pm) β€” go validate something cute and matching, mwah πŸŽ€βœ¨πŸ¦‹πŸ’–

πŸ“¦ where this page comes from