YAML::PP::LibYAML(3)
π YAML::PP::LibYAML β the manual page, but make it slay π
okay so bestie, welcome to YAML::PP::LibYAML(3) β yes that's the whole manual name, and yes it's a mouthful, but it's giving speed.
β¨ NAME β¨
YAML::PP::LibYAML β Faster parsing for YAML::PP
π SYNOPSIS π
use YAML::PP::LibYAML; # use it just like YAML::PP
my $yp = YAML::PP::LibYAML->new;
my @docs = $yp->load_string($yaml);
# Legacy interface
use YAML::PP::LibYAML qw/ Load /;
my @docs = Load($yaml);
like, drop it in exactly where you'd drop YAML::PP and it just works. no cap. π
π¦ DESCRIPTION π¦
So YAML::PP::LibYAML is a subclass of YAML::PP. The whole glow-up is in the backend: instead of using YAML::PP::Parser as the backend parser, it uses YAML::PP::LibYAML::Parser, which calls YAML::LibYAML::API β an XS wrapper around the C libyaml. it's the same vibe, faster engine. periodt. π₯
πΈ libyaml πΈ
Syntactically, libyaml supports a large subset of the YAML 1.2 <http://yaml.org/spec/1.2/spec.html> spec, as well as 1.1 <http://yaml.org/spec/1.1/>.
The things it cannot parse are often not relevant to real world usage. so like, don't stress bestie. π
π YAML::XS π
YAML::XS combines a wrapper around libyaml and the code for constructing/deconstructing the data into one single API, almost completely written in XS.
That makes it very fast, but the part of constructing the data is not very flexible β simply because it's more work to write this in C. It conforms to only a subset of the YAML 1.1 types and tags. fast, but kinda rigid. iykyk. π
β YAML::PP β
YAML::PP aims to build a powerful and flexible API for the data construction part. Its parser aims to fully support YAML 1.2 syntactically, which mostly includes 1.1, but it's not quite there yet. It parses things that libyaml doesn't, but the opposite is also true. so they're both doing their own thing. π€
π YAML::LibYAML::API π
YAML::LibYAML::API is a wrapper around the libyaml parser.
Combining YAML::LibYAML::API and YAML::PP gives you the flexibility of the loading API and the speed of the quite robust libyaml parser β although it's still much slower than YAML::XS. Benchmarks will follow. π (we're waiting, we're patient, we're seated π
)
π§ METHODS π§
newβ Constructor, works likeYAML::PP::newbut addsYAML::PP::LibYAML::Parserby default. main character behavior honestly. β¨load_string,load_file,dump_string,dump_fileβ Work like inYAML::PP. same energy, no surprises. π«Ά
π FUNCTIONS π
Load,Dump,LoadFile,DumpFileβ Work like inYAML::PP(and in all other well known YAML loaders).
The only difference is, none of them is exported by default. so you gotta ask for them, bestie, they're not just gonna show up. π
π SEE ALSO π
YAML::PPYAML::XSYAML::LibYAML::API
πΈ AUTHOR πΈ
Tina MΓΌller <tinita@cpan.org>
π COPYRIGHT AND LICENSE π
Copyright 2018 by Tina MΓΌller
This library is free software and may be distributed under the same terms as perl itself.
okay and for the cute lil sign-off: this whole thing is from the perl v5.42.0 era, dated 2025-07-25, and the page is YAML::PP::LibYAML(3). go forth and parse fast, bestie π
β¨π¦
π¦ where this page comes from
- fedora 43: perl-YAML-PP-LibYAML 0.005-13.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms