1CPAN::Meta::YAML(3) User Contributed Perl Documentation CPAN::Meta::YAML(3)
2
3
4
6 CPAN::Meta::YAML - Read and write a subset of YAML for CPAN Meta files
7
9 version 0.008
10
12 use CPAN::Meta::YAML;
13
14 # reading a META file
15 open $fh, "<:utf8", "META.yml";
16 $yaml_text = do { local $/; <$fh> };
17 $yaml = CPAN::Meta::YAML->read_string($yaml_text)
18 or die CPAN::Meta::YAML->errstr;
19
20 # finding the metadata
21 $meta = $yaml->[0];
22
23 # writing a META file
24 $yaml_text = $yaml->write_string
25 or die CPAN::Meta::YAML->errstr;
26 open $fh, ">:utf8", "META.yml";
27 print $fh $yaml_text;
28
30 This module implements a subset of the YAML specification for use in
31 reading and writing CPAN metadata files like META.yml and MYMETA.yml.
32 It should not be used for any other general YAML parsing or generation
33 task.
34
35 NOTE: META.yml (and MYMETA.yml) files should be UTF-8 encoded. Users
36 are responsible for proper encoding and decoding. In particular, the
37 "read" and "write" methods do not support UTF-8 and should not be used.
38
40 This module is currently derived from YAML::Tiny by Adam Kennedy. If
41 there are bugs in how it parses a particular META.yml file, please file
42 a bug report in the YAML::Tiny bugtracker:
43 <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=YAML-Tiny>
44
46 YAML::Tiny, YAML, YAML::XS
47
49 Bugs / Feature Requests
50 Please report any bugs or feature requests through the issue tracker at
51 <http://rt.cpan.org/Public/Dist/Display.html?Name=CPAN-Meta-YAML>. You
52 will be notified automatically of any progress on your issue.
53
54 Source Code
55 This is open source software. The code repository is available for
56 public review and contribution under the terms of the license.
57
58 <https://github.com/dagolden/cpan-meta-yaml>
59
60 git clone https://github.com/dagolden/cpan-meta-yaml.git
61
63 · Adam Kennedy <adamk@cpan.org>
64
65 · David Golden <dagolden@cpan.org>
66
68 This software is copyright (c) 2010 by Adam Kennedy.
69
70 This is free software; you can redistribute it and/or modify it under
71 the same terms as the Perl 5 programming language system itself.
72
73
74
75perl v5.16.3 2012-03-14 CPAN::Meta::YAML(3)