Badger...c::YAML(3pm)
π 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 π
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::CodecsBadger::CodecYAML
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
- debian trixie: libbadger-perl 0.16-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libbadger-perl 0.16-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libbadger-perl 0.16-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms