perldoc > YAML::XS

🏷️ NAME

YAML::XS - Perl YAML Serialization using XS and libyaml

πŸš€ Quick Reference

Use CaseCommandDescription
Dump a Perl data structure to YAMLDump @dataConverts Perl array/hash to YAML string
Load a YAML string to PerlLoad $yamlParses YAML string into Perl data structure
Dump to fileDumpFile $filename, @dataWrites YAML to a file
Load from fileLoadFile $filenameReads YAML from a file

πŸ“ SYNOPSIS

use YAML::XS;

my $yaml = Dump [ 1..4 ];
my $array = Load $yaml;

πŸ“– DESCRIPTION

Kirill Simonov's "libyaml" is arguably the best YAML implementation. The C library is written precisely to the YAML 1.1 specification. It was originally bound to Python and was later bound to Ruby.

This module is a Perl XS binding to libyaml which offers Perl the best YAML support to date.

This module exports the functions "Dump", "Load", "DumpFile" and "LoadFile". These functions are intended to work exactly like "YAML.pm"'s corresponding functions. Only "Load" and "Dump" are exported by default.

βš™οΈ CONFIGURATION

🌐 USING YAML::XS WITH UNICODE

Handling unicode properly in Perl can be a pain. YAML::XS only deals with streams of utf8 octets. Just remember this:

$perl = Load($utf8_octets);
$utf8_octets = Dump($perl);

There are many, many places where things can go wrong with unicode. If you are having problems, use Devel::Peek on all the possible data points.

πŸ“š LIBYAML

You can find out (since v.079) which libyaml version this module was built with:

my $libyaml_version = YAML::XS::LibYAML::libyaml_version();

πŸ”— SEE ALSO

πŸ‘€ AUTHOR

Ingy dΓΆt Net <ingy AT cpan.org>

©️ COPYRIGHT AND LICENSE

Copyright 2007-2021. Ingy dΓΆt Net.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

See http://www.perl.com/perl/misc/Artistic.html

YAML::XS
🏷️ NAME πŸš€ Quick Reference πŸ“ SYNOPSIS πŸ“– DESCRIPTION βš™οΈ CONFIGURATION 🌐 USING YAML::XS WITH UNICODE πŸ“š LIBYAML πŸ”— SEE ALSO πŸ‘€ AUTHOR ©️ COPYRIGHT AND LICENSE

Generated by phpman v4.9.26-5-g7740029 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-08-21 20:38 @216.73.217.134
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Valid XHTML 1.0 Transitional!Valid CSS!

^_top_^