# info > CPAN::Meta::Validator

---
type: CommandReference
command: CPAN::Meta::Validator
mode: perldoc
section: 3perl
source: perldoc
---

## Quick Reference

- `CPAN::Meta::Validator->new($struct)` — create a validator from a metadata structure
- `$cmv->is_valid` — returns true if metadata is valid
- `$cmv->errors` — returns list of validation errors

## Name

CPAN::Meta::Validator - validate CPAN distribution metadata structures

## Synopsis

perl
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;
}
## Methods

- `$cmv->new($struct)` — constructor; must be passed a metadata structure
- `$cmv->is_valid` — returns a boolean indicating whether the metadata is valid
- `$cmv->errors` — returns a list of errors seen during validation

## Examples

(Same as Synopsis above.)

## See Also

- [CPAN::Meta](https://metacpan.org/pod/CPAN::Meta)