CPAN::META::VALIDATOR(3perl)
β¨ CPAN::Meta::Validator π (that's the 3perl manual, bestie)
okay so real talk, this page lives in the Perl Programmers Reference Guide and it's about checking whether your CPAN dist metadata is actually valid, and honestly? iconic. π
πΈ NAME
CPAN::Meta::Validator β bestie, its whole job is validating CPAN distribution metadata structures. that's it. that's the gig. π
π¦ VERSION
version 2.150013 β¨
π SYNOPSIS
okay so here's the whole vibe in code, no notes:
my $struct = decode_json_file('META.json');
my $cmv = CPAN::Meta::Validator->new( $struct );
unless ( $cmv->is_valid ) {
my $msg = "Invalid META structure. Errors found:\n";
$msg .= join( "\n", $cmv->errors );
die $msg;
}
like. decode the META.json, hand it to the validator, and if it's not valid you die with all the errors joined up. slay. ππ
π DESCRIPTION
so this module validates a CPAN Meta structure β and the way it does that is lowkey the smart part: it checks your structure against the version of the specification that the structure itself claims in its meta-spec field. it's giving "read the room, then judge accordingly" and we're obsessed. π
π METHODS
π new
my $cmv = CPAN::Meta::Validator->new( $struct )
the constructor. you must pass it a metadata structure β it literally cannot start without one, periodt. β¨
π is_valid
if ( $cmv->is_valid ) {
...
}
returns a boolean value that tells you whether the metadata you handed over is valid. true = valid, false = not valid, iykyk. π«Ά
π¦ errors
warn( join "\n", $cmv->errors );
returns a list of errors that turned up during validation. every single one. so you can print them, warn them, join them, whatever your heart desires. π
π BUGS
bestie, if you find a bug or you're craving a feature, please report it using the CPAN Request Tracker. bugs can be submitted through the web interface right here:
<http://rt.cpan.org/Dist/Display.html?Queue=CPAN-Meta>
and when you do submit a bug or a request, please include a test-file β or a patch to an existing test-file β that shows off the bug or the feature you want. that's the whole ask. don't make them guess, that's not the vibe. π
π AUTHORS
- David Golden
<dagolden@cpan.org> - Ricardo Signes
<cpan@semiotic.systems> - Adam Kennedy
<adamk@cpan.org>
three absolute legends fr fr. π§π
β COPYRIGHT AND LICENSE
this software is copyright (c) 2010 by David Golden, Ricardo Signes, Adam Kennedy and Contributors.
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 go off, responsibly. πΈ
and that's the page, babe π β this was CPAN::Meta::Validator(3perl) from perl v5.44.0, dated 2026-10-17. go validate something and feel gorgeous doing it. πβ¨π¦
π¦ where this page comes from
- arch rolling: perl 5.44.0-1 Β· Artistic-1.0-Perl AND 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