YAML::PP::Ref(3)
β¨ NAME β¨
YAML::PP::Ref β it's the Generated Reference Parser backend for YAML::PP π bestie, that's literally the whole vibe
πΈ SYNOPSIS πΈ
okay so here's how you actually use it, no cap:
my $ypp = YAML::PP::Ref->new;
my $data = $ypp->load_string($yaml);
my $data = $ypp->load_file($file);
open my $fh, '<:encoding(UTF-8)', $file or die $!;
my $data = $ypp->load_file($fh);
close $fh;
π¦ DESCRIPTION π¦
so the YAML Specification over at <https://yaml.org/> can literally be used to generate a YAML Parser straight from it. like, the spec is the blueprint π
Ingy did that for a bunch of languages, and the Perl one lives right here: <https://metacpan.org/dist/YAML-Parser>. iconic behavior honestly π
This module swaps out the default YAML::PP::Parser parsing backend and drops YAML::Parser in its place. so what you get is a Parser that's 100% compliant to the spec β¨ plus all of YAML::PP's functionalities stacked on top of it β like loading the parsing events into a data structure, and using the various YAML::PP plugins. best of both worlds fr fr π«Ά
lowkey important heads-up: at the time of this release, it's quite slow compared to other Perl YAML modules π but honestly it might not make a difference for you depending on your application. the grammar for YAML 1.2 is not optimized for speed. that's just the tea β
also the error messages are not really helpful currently π like, they're giving nothing. sorry bestie.
pro tip from the page itself: check out the documentation of YAML::Parser regularly β these things might have changed meanwhile π
π COPYRIGHT AND LICENSE π
Copyright 2021 by Tina MΓΌller πΈ
This library is free software and may be distributed under the same terms as perl itself. slay, go forth and share π«Ά
and that's the whole page bestie!! this doc is from perl v5.42.0 and it's dated 2025-07-25, part of the User Contributed Perl Documentation collection π mwah, bye! π β¨
π¦ where this page comes from
- fedora 43: perl-YAML-PP-Ref 0.02-10.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