Data::YAML(3pm)
π Data::YAML β the manpage, but make it make sense π
okay bestie, gather round, because this is the Data::YAML page from section 3pm (that's the Perl-module corner of the manual, iykyk) and it's literally about making your Perl data structures survive a round trip into YAML and back without losing their whole personality. π¦
β¨ VERSION β¨
This doc is describing Data::YAML version 0.0.7. no cap, that's the number. πΈ
π DESCRIPTION π
so the vibe here is "in the spirit of YAML::Tiny" β Data::YAML::Reader and Data::YAML::Writer are out here doing lightweight, dependency-free YAML handling. π«Ά
but here's the plot twist: YAML::Tiny is designed principally for working with configuration files, whereas Data::YAML is obsessed (rightly) with the transparent round-tripping of YAML-serialized Perl data structures. those are two different jobs and the difference actually matters.
for example β and this is the tea β YAML::Tiny doesn't handle hashes with keys containing non-printable characters. for a config file? fine, whatever, no notes. for arbitrary Perl data structures? bestie that's gonna cause problems. Data::YAML handles exotic hash keys correctly. π
the syntax accepted by Data::YAML is a subset of YAML. specifically, it's the same subset of YAML that Data::YAML::Writer produces. See Data::YAML for more information.
π§ YAML syntax π§
YAML looks like a simple language but the entire YAML specification is huge. Data::YAML implements a small subset of the complete syntax, trading completeness for compactness and simplicity. this restricted syntax is known (to me at least) as 'YAMLish'. π
these examples demonstrate the full range of supported syntax, so pay attention because this is the whole menu:
all YAML documents must begin with --- and end with a line containing ....
--- Simple scalar
...
unprintable characters are represented using standard escapes in double quoted strings.
--- "\t\x01\x02\n"
...
arrays and hashes are represented thusly:
---
- "This"
- "is"
- "an"
- "array"
...
---
This: is
a: hash
...
structures may nest arbitrarily, go off:
---
-
name: 'Hash one'
value: 1
-
name: 'Hash two'
value: 2
...
and undef is a tilde. that's it. that's the whole undef. γ°οΈ
--- ~
...
π Uses π
use Data::YAML any time you need to freeze and thaw Perl data structures into a human readable format. the output from Data::YAML::Writer should be readable by any YAML parser. iconic behaviour honestly.
Data::YAML was originally written to allow machine-readable diagnostic information to be passed from test scripts to TAP::Harness. which means: if you're writing a testing system that needs to output TAP version 13 or later syntax, you might find Data::YAML useful. π
read more about TAP and YAMLish here: http://testanything.org/wiki
π BUGS AND LIMITATIONS π
no bugs have been reported. (we love a clean record, manifesting that energy forever β¨)
please report any bugs or feature requests to data-yaml@rt.cpan.org, or through the web interface at http://rt.cpan.org.
π AUTHOR π
Andy Armstrong <andy@hexten.net>
π LICENCE AND COPYRIGHT π
Copyright (c) 2007, Andy Armstrong <andy@hexten.net>. All rights reserved.
this module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.
π DISCLAIMER OF WARRANTY π
okay this part is the scary part, so read it properly, not me skimming the terms and conditions:
BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. except when otherwise stated in writing, the copyright holders and/or other parties provide the software "AS IS" without warranty of any kind, either expressed or implied, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose. the entire risk as to the quality and performance of the software is with you. should the software prove defective, you assume the cost of all necessary servicing, repair, or correction. π«
IN NO EVENT, unless required by applicable law or agreed to in writing, will any copyright holder, or any other party who may modify and/or redistribute the software as permitted by the above licence, be liable to you for damages, including any general, special, incidental, or consequential damages arising out of the use or inability to use the software (including but not limited to loss of data or data being rendered inaccurate or losses sustained by you or third parties or a failure of the software to operate with any other software), even if such holder or other party has been advised of the possibility of such damages.
and that's the whole page, bestie π this was Data::YAML, documented as perl v5.36.0, dated 2022-10-15 β and that's the entire scandal. go forth and round-trip responsibly. πβ¨π¦
π¦ where this page comes from
- ubuntu noble: libdata-yaml-perl 0.0.7-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libdata-yaml-perl 0.0.7-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libdata-yaml-perl 0.0.7-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