YAML::PP::Ref(3)

πŸ“¦
version 0.02 Β· 2 versions
, in fedora 43

✨ 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 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