1YAML::PP::LibYAML(3)  User Contributed Perl Documentation YAML::PP::LibYAML(3)
2
3
4

NAME

6       YAML::PP::LibYAML - Faster parsing for YAML::PP
7

SYNOPSIS

9           use YAML::PP::LibYAML; # use it just like YAML::PP
10           my $yp = YAML::PP::LibYAML->new;
11           my @docs = $yp->load_string($yaml);
12
13           # Legacy interface
14           use YAML::PP::LibYAML qw/ Load /;
15           my @docs = Load($yaml);
16

DESCRIPTION

18       YAML::PP::LibYAML is a subclass of YAML::PP. Instead of using
19       YAML::PP::Parser as a the backend parser, it uses
20       YAML::PP::LibYAML::Parser which calls YAML::LibYAML::API, an XS wrapper
21       around the "C libyaml".
22
23   libyaml
24       Syntactically libyaml supports a large subset of the YAML 1.2
25       <http://yaml.org/spec/1.2/spec.html> spec as well as 1.1
26       <http://yaml.org/spec/1.1/>.
27
28       The things it cannot parse are often not relevant to real world usage.
29
30   YAML::XS
31       YAML::XS combines a wrapper around libyaml and the code for
32       constructing/deconstructing the data into one single API, almost
33       completely written in XS.
34
35       That makes it very fast, but the part of constructing the data is not
36       very flexible simply because it's more work to write this in C. It
37       conforms to only a subset of the YAML 1.1 types and tags.
38
39   YAML::PP
40       YAML::PP aims to build a powerful and flexible API for the data
41       construction part.  Its parser aims to fully support YAML 1.2
42       syntactically, which mostly includes 1.1, but it's not quite there yet.
43       It parses things that libyaml doesn't, but the opposite is also true.
44
45   YAML::LibYAML::API
46       YAML::LibYAML::API is a wrapper around the libyaml parser.
47
48       Combining YAML::LibYAML::API and YAML::PP gives you the flexibility of
49       the loading API and the speed of the quite robust libyaml parser,
50       although it's still much slower than YAML::XS. Benchmarks will follow.
51

METHODS

53       new Constructor, works like YAML::PP::new but adds
54           YAML::PP::LibYAML::Parser by default.
55
56       load_string, load_file, dump_string, dump_file
57           Work like in YAML::PP
58

FUNCTIONS

60       Load, Dump, LoadFile, DumpFile
61           Work like in YAML::PP (and in all other well known YAML loaders).
62
63           The only difference is, none of them is exported by default.
64

SEE ALSO

66       YAML::PP
67       YAML::XS
68       YAML::LibYAML::API
69

AUTHOR

71       Tina Müller <tinita@cpan.org>
72
74       Copyright 2018 by Tina Müller
75
76       This library is free software and may be distributed under the same
77       terms as perl itself.
78
79
80
81perl v5.38.0                      2023-07-21              YAML::PP::LibYAML(3)
Impressum