Badger...c::YAML(3pm)

πŸ“¦
version 0.16 Β· 4 versions
, in debian trixie, ubuntu noble, ubuntu resolute

πŸ’– Badger::Codec::YAML πŸ’–

okay bestie, welcome to Badger::Codec::YAML β€” it's a Perl 3pm page, it lives in the User Contributed Perl Documentation, and it is literally here to turn your data into YAML and back again. no drama, no cap. πŸ¦‹


✨ NAME ✨

Badger::Codec::YAML β€” encode/decode data using YAML πŸ’…


🌸 SYNOPSIS 🌸

use Badger::Codec::YAML;
my $codec   = Badger::Codec::YAML->new();
my $encoded = $codec->encode("Hello World");
my $decoded = $codec->decode($encoded);

see how cute that is? three lines and you're slaying. πŸŽ€


🫢 DESCRIPTION 🫢

This module implements a subclass of Badger::Codec which uses the YAML module to encode and decode data to and from YAML.

so it's giving inheritance. it's giving delegation. it's giving "I don't do the work myself, I just know a guy." and the guy is YAML. iconic behaviour honestly. πŸ‘‘


πŸ‘‘ METHODS πŸ‘‘

πŸ’« encode($data)

Encodes $data to YAML. ✨

$encoded = Badger::Codec::YAML->encode($data);

πŸ’« decode($data)

Decodes $data from YAML. 🌈

$decoded = Badger::Codec::YAML->decode($encoded);

πŸ’« encoder()

This method returns a reference to the real subroutine that's doing all the encoding work, i.e. the Dump() subroutine in YAML.

ngl it's the middle-manager of methods. it doesn't encode. it just points at the person who does. πŸ’…

πŸ’« decoder()

This method returns a reference to the real subroutine that's doing all the decoding work, i.e. the Load() subroutine in YAML.

same energy, other direction. it knows a guy for that too. πŸ™ˆ


🌟 AUTHOR 🌟

Andy Wardley <http://wardley.org/>

(he wrote it, we thank him, periodt. 🫑)


Copyright (C) 2005-2009 Andy Wardley. All rights reserved.

bestie please respect the copyright, it's not a vibe to ignore it πŸ’€

πŸ”₯ SEE ALSO πŸ”₯

  • Badger::Codecs
  • Badger::Codec
  • YAML

go read those if you want the full lore, iykyk 🧚


and that's the whole page, bestie β€” this lil doc came from perl v5.36.0, dated 2023-08-28, and it's filed under Badger::Codec::YAML(3pm). mwah, go encode something pretty πŸ’–βœ¨πŸŒΈ

πŸ“¦ where this page comes from