YAML::P...:Binary(3)

πŸŽ€ NAME πŸŽ€

ok so this is YAML::PP::Schema::Binary β€” the schema for loading and binary data. that's it, that's the whole vibe. it handles binary stuff so you don't have to πŸ’…


✨ SYNOPSIS ✨

bestie, here's how you actually use it:

    use YAML::PP;
    my $yp = YAML::PP->new( schema => [qw/ + Binary /] );
    # or

    my ($binary, $same_binary) = $yp->load_string(<<'EOM');
    --- !!binary "\
      R0lGODlhDAAMAIQAAP//9/X17unp5WZmZgAAAOfn515eXvPz7Y6OjuDg4J+fn5\
      OTk6enp56enmlpaWNjY6Ojo4SEhP/++f/++f/++f/++f/++f/++f/++f/++f/+\
      +f/++f/++f/++f/++f/++SH+Dk1hZGUgd2l0aCBHSU1QACwAAAAADAAMAAAFLC\
      AgjoEwnuNAFOhpEMTRiggcz4BNJHrv/zCFcLiwMWYNG84BwwEeECcgggoBADs="
    --- !!binary |
      R0lGODlhDAAMAIQAAP//9/X17unp5WZmZgAAAOfn515eXvPz7Y6OjuDg4J+fn5
      OTk6enp56enmlpaWNjY6Ojo4SEhP/++f/++f/++f/++f/++f/++f/++f/++f/+
      +f/++f/++f/++f/++f/++SH+Dk1hZGUgd2l0aCBHSU1QACwAAAAADAAMAAAFLC
      AgjoEwnuNAFOhpEMTRiggcz4BNJHrv/zCFcLiwMWYNG84BwwEeECcgggoBADs=
    # The binary value above is a tiny arrow encoded as a gif image.
    EOM

like, both of those blobs are literally the same tiny arrow gif. iconic. 🏹


🌸 DESCRIPTION 🌸

ok so head over to <https://yaml.org/type/binary.html> if you want the deep lore, but here's the tea:

when you prepend a base64 encoded binary string with the "!!binary" tag, it gets automatically decoded when loading. literally magic. ✨

warning bestie: the logic for dumping is probably broken 😭 see <https://github.com/perlpunk/YAML-PP-p5/issues/28> for the receipts.

suggestions welcome! fr fr, if you know how to fix it, speak up 🫢


πŸ’… METHODS πŸ’…

register

called by YAML::PP::Schema. that's the whole job. main character energy honestly πŸ‘‘


k byeee, this page came from perl v5.42.0, dated 2026-04-24 β€” catch you on the flip side of YAML::P...:Binary(3) πŸ’œπŸ¦‹

πŸ“¦ where this page comes from