View on
MetaCPAN is shutting down
For details read Perl NOC. After June 25th this page will redirect to
David E. Wheeler > PGXN-Meta-Validator-v0.16.0 > PGXN::Meta::Validator



Annotate this POD


View/Report Bugs
Module Version: v0.16.0   Source  

Name ^

PGXN::Meta::Validator - Validate PGXN distribution metadata structures

Synopsis ^

  my $struct = decode_json_file('META.json');

  my $pmv = PGXN::Meta::Validator->new( $struct );

  unless ( $pmv->is_valid ) {
      my $msg = "Invalid META structure. Errors found:\n";
      $msg .= join( "\n", $pmv->errors );
      die $msg;

Description ^

This module validates a PGXN Meta structure against the version of the the specification claimed in the meta-spec field of the structure. Currently, there is only v1.0.0.

Interface ^



  my $pmv = PGXN::Meta::Validator->new( $struct )

The constructor must be passed a metadata structure.


  my $meta = PGXN::Meta::Validator->load_file('META.json');

Reads in the specified JSON file and passes the resulting data structure to new(), returning the resulting PGXN::Meta::Validator object. An exception will be thrown if the file does not exist or if its contents are not valid JSON.

Class Method


  say 'PGXN::Meta::Validator ', PGXN::Meta::Validator->version_string;

Returns a string representation of the PGXN::Meta::Validator version.

Instance Methods


  if ( $pmv->is_valid ) {

Returns a boolean value indicating whether the metadata provided is valid.


  warn( join "\n", $pmv->errors );

Returns a list of errors seen during validation.

Support ^

This module is stored in an open GitHub repository. Feel free to fork and contribute!

Please file bug reports via GitHub Issues or by sending mail to

syntax highlighting: