Valida...itcard(3pm)
π³ Validation::Class::Directive::Creditcard β the creditcard directive, bestie
okay so real quick, the manual name is Valida...itcard(3pm) (yes the title is truncated, that's just how the page header renders it, don't come for me) and it lives in the User Contributed Perl Documentation section. It's the Validation::Class::Directive::Creditcard page β aka the Creditcard Directive for Validation Class Field Definitions. π
β¨ VERSION β¨
version 7.900059 π
πΈ SYNOPSIS πΈ
here's the whole vibe, copy-paste ready:
use Validation::Class::Simple;
my $rules = Validation::Class::Simple->new(
fields => {
person_cc => {
creditcard => 1
}
}
);
# set parameters to be validated
$rules->params->add($parameters);
# validate
unless ($rules->validate) {
# handle the failures
}
so you build your rules, you add your $parameters to $rules->params, and then you validate β and if it comes back false, unless catches it and you handle the failures. that's it, that's the whole loop π¦
π DESCRIPTION π
Validation::Class::Directive::Creditcard is a core validation class field directive that provides validation for american express, bankcard, diners card, discover card, electron, enroute, jcb, maestro, mastercard, solo, switch, visa and voyager credit cards. literally all of them. no cap. π«Ά
- alternative argument: an-array-of-options
- option:
amex - option:
bankcard - option:
diners - option:
disc - option:
electron - option:
enroute - option:
jcb - option:
maestro - option:
mastercard - option:
solo - option:
switch - option:
visa - option:
voyager
the way that this directive can be passed a single value or an array of values β both are valid, you're not doing it wrong either way:
fields => {
person_cc => {
creditcard => ['visa', 'mastercard']
}
}
look at that array of options just doing its little thing. iconic behavior tbh πβ¨
π AUTHOR π
Al Newkirk <anewkirk@ana.io> β king shit, respect π
π 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.
so basically: free software, same terms as Perl 5, go wild, just don't be weird about the copyright. fr fr π
okay bestie that's the whole page β you ate that π
and for the record, this lil doc is from perl v5.36.0, dated 2023-06-11, and the page header/footer both say Valida...itcard(3pm) because the man page name is just Like That. bye bestie, go validate some credit cards π¦πβ¨
π¦ 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