Modules

  • ABCDE
  • FGHIL
  • MNOPS
  • TUX

Tools

Parse::CPAN::Meta

Perl 5 version 12.2 documentation
Recently read

Parse::CPAN::Meta

NAME

Parse::CPAN::Meta - Parse META.yml and other similar CPAN metadata files

SYNOPSIS

  1. #############################################
  2. # In your file
  3. ---
  4. rootproperty: blah
  5. section:
  6. one: two
  7. three: four
  8. Foo: Bar
  9. empty: ~
  10. #############################################
  11. # In your program
  12. use Parse::CPAN::Meta;
  13. # Create a YAML file
  14. my @yaml = Parse::CPAN::Meta::LoadFile( 'Meta.yml' );
  15. # Reading properties
  16. my $root = $yaml[0]->{rootproperty};
  17. my $one = $yaml[0]->{section}->{one};
  18. my $Foo = $yaml[0]->{section}->{Foo};

DESCRIPTION

Parse::CPAN::Meta is a parser for META.yml files, based on the parser half of YAML::Tiny.

It supports a basic subset of the full YAML specification, enough to implement parsing of typical META.yml files, and other similarly simple YAML files.

If you need something with more power, move up to a full YAML parser such as YAML, YAML::Syck or YAML::LibYAML.

Parse::CPAN::Meta provides a very simply API of only two functions, based on the YAML functions of the same name. Wherever possible, identical calling semantics are used.

All error reporting is done with exceptions (die'ing).

FUNCTIONS

For maintenance clarity, no functions are exported.

Load

  1. my @yaml = Load( $string );

Parses a string containing a valid YAML stream into a list of Perl data structures.

LoadFile

  1. my @yaml = LoadFile( 'META.yml' );

Reads the YAML stream from a file instead of a string.

SUPPORT

Bugs should be reported via the CPAN bug tracker at

http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Parse-CPAN-Meta

AUTHOR

Adam Kennedy <adamk@cpan.org>

SEE ALSO

YAML, YAML::Syck, Config::Tiny, CSS::Tiny, http://use.perl.org/~Alias/journal/29427, http://ali.as/

COPYRIGHT

Copyright 2006 - 2009 Adam Kennedy.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

The full text of the license can be found in the LICENSE file included with this module.