1CPAN::Meta::Validator(3U)ser Contributed Perl DocumentatiCoPnAN::Meta::Validator(3)
2
3
4
6 CPAN::Meta::Validator - validate CPAN distribution metadata structures
7
9 version 2.150010
10
12 my $struct = decode_json_file('META.json');
13
14 my $cmv = CPAN::Meta::Validator->new( $struct );
15
16 unless ( $cmv->is_valid ) {
17 my $msg = "Invalid META structure. Errors found:\n";
18 $msg .= join( "\n", $cmv->errors );
19 die $msg;
20 }
21
23 This module validates a CPAN Meta structure against the version of the
24 the specification claimed in the "meta-spec" field of the structure.
25
27 new
28 my $cmv = CPAN::Meta::Validator->new( $struct )
29
30 The constructor must be passed a metadata structure.
31
32 is_valid
33 if ( $cmv->is_valid ) {
34 ...
35 }
36
37 Returns a boolean value indicating whether the metadata provided is
38 valid.
39
40 errors
41 warn( join "\n", $cmv->errors );
42
43 Returns a list of errors seen during validation.
44
46 Please report any bugs or feature using the CPAN Request Tracker. Bugs
47 can be submitted through the web interface at
48 <http://rt.cpan.org/Dist/Display.html?Queue=CPAN-Meta>
49
50 When submitting a bug or request, please include a test-file or a patch
51 to an existing test-file that illustrates the bug or desired feature.
52
54 · David Golden <dagolden@cpan.org>
55
56 · Ricardo Signes <rjbs@cpan.org>
57
58 · Adam Kennedy <adamk@cpan.org>
59
61 This software is copyright (c) 2010 by David Golden, Ricardo Signes,
62 Adam Kennedy and Contributors.
63
64 This is free software; you can redistribute it and/or modify it under
65 the same terms as the Perl 5 programming language system itself.
66
67
68
69perl v5.28.1 2016-08-18 CPAN::Meta::Validator(3)