MainMethods
• parse()
Using the given data structure provided with the constructor, attempts to parse and validate
according to the appropriate specification definition.
Returns 1 if any errors found, otherwise returns 0.
• errors()
Returns a list of the errors found during parsing.
CheckMethods
• check_map($spec,$data)
Checks whether a map (or hash) part of the data structure conforms to the appropriate specification
definition.
• check_list($spec,$data)
Checks whether a list (or array) part of the data structure conforms to the appropriate specification
definition.
ValidatorMethods
• header($self,$key,$value)
Validates that the YAML header is valid.
Note: No longer used as we now read the YAML data structure, not the file.
• url($self,$key,$value)
Validates that a given value is in an acceptable URL format
• urlspec($self,$key,$value)
Validates that the URL to a META.yml specification is a known one.
• string_or_undef($self,$key,$value)
Validates that the value is either a string or an undef value. Bit of a catchall function for parts
of the data structure that are completely user defined.
• string($self,$key,$value)
Validates that a string exists for the given key.
• file($self,$key,$value)
Validate that a file is passed for the given key. This may be made more thorough in the future. For
now it acts like \&string.
• exversion($self,$key,$value)
Validates a list of versions, e.g. '<= 5, >=2, ==3, !=4, >1, <6, 0'.
• version($self,$key,$value)
Validates a single version string. Versions of the type '5.8.8' and '0.00_00' are both valid. A
leading 'v' like 'v1.2.3' is also valid.
• boolean($self,$key,$value)
Validates for a boolean value. Currently these values are '1', '0', 'true', 'false', however the
latter 2 may be removed.
• license($self,$key,$value)
Validates that a value is given for the license. Returns 1 if an known license type, or 2 if a value
is given but the license type is not a recommended one.
• resource($self,$key,$value)
Validates that the given key is in CamelCase, to indicate a user defined keyword.
• keyword($self,$key,$value)
Validates that key is in an acceptable format for the META.yml specification, i.e. any in the
character class [-_a-z].
For user defined keys, although not explicitly stated in the specifications (v1.0 - v1.4), the
convention is to precede the key with a pattern matching qr{\Ax_}i. Following this any character from
the character class [-_a-zA-Z] can be used. This clarification has been added to v2.0 of the
specification.
• identifier($self,$key,$value)
Validates that key is in an acceptable format for the META.yml specification, for an identifier, i.e.
any that matches the regular expression qr/[a-z][a-z_]/i.
• module($self,$key,$value)
Validates that a given key is in an acceptable module name format, e.g. 'Test::CPAN::Meta::Version'.
• anything($self,$key,$value)
Usually reserved for user defined structures, allowing them to be considered valid without a need for
a specification definition for the structure.