.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Data::YAML::Reader 3pm" .TH Data::YAML::Reader 3pm "2022-10-15" "perl v5.34.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Data::YAML::Reader \- Parse YAML created by Data::YAML::Writer .SH "VERSION" .IX Header "VERSION" This document describes Data::YAML::Reader version 0.0.7 .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Data::YAML::Reader; \& \& my $yr = Data::YAML::Reader\->new; \& \& # Read from an array... \& my $from_array = $yr\->read( \e@some_array ); \& \& # ...an open file handle... \& my $from_handle = $yr\->read( $some_file ); \& \& # ...a string containing YAML... \& my $from_string = $yr\->read( $some_string ); \& \& # ...or a closure \& my $from_code = $yr\->read( sub { return get_next_line() } ); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" In the spirit of YAML::Tiny this is a lightweight, dependency-free \&\s-1YAML\s0 reader. While \f(CW\*(C`YAML::Tiny\*(C'\fR is designed principally for working with configuration files \f(CW\*(C`Data::YAML\*(C'\fR concentrates on the transparent round-tripping of \s-1YAML\s0 serialized Perl data structures. .PP The syntax accepted by \f(CW\*(C`Data::YAML::Reader\*(C'\fR is a subset of \s-1YAML.\s0 Specifically it is the same subset of \s-1YAML\s0 that Data::YAML::Writer produces. See Data::YAML for more information. .SH "INTERFACE" .IX Header "INTERFACE" .ie n .IP """new""" 4 .el .IP "\f(CWnew\fR" 4 .IX Item "new" Creates and returns an empty \f(CW\*(C`Data::YAML::Reader\*(C'\fR object. No options may be passed. .ie n .IP """read( $source )""" 4 .el .IP "\f(CWread( $source )\fR" 4 .IX Item "read( $source )" Read \s-1YAML\s0 and return the data structure it represents. The \s-1YAML\s0 data may be supplied by a .RS 4 .IP "\(bu" 4 scalar string containing \s-1YAML\s0 source .IP "\(bu" 4 the handle of an open file .IP "\(bu" 4 a reference to an array of lines .IP "\(bu" 4 a code reference .RE .RS 4 .Sp In the case of a code reference a subroutine (most likely a closure) that returns successive lines of \s-1YAML\s0 must be supplied. Lines should have no trailing newline. When the \s-1YAML\s0 is exhausted the subroutine must return undef. .Sp Returns the data structure (specifically either a scalar, hash ref or array ref) that results from decoding the \s-1YAML.\s0 .RE .ie n .IP """get_raw""" 4 .el .IP "\f(CWget_raw\fR" 4 .IX Item "get_raw" Return the raw \s-1YAML\s0 source from the most recent \f(CW\*(C`read\*(C'\fR. .SH "BUGS AND LIMITATIONS" .IX Header "BUGS AND LIMITATIONS" No bugs have been reported. .PP Please report any bugs or feature requests to \&\f(CW\*(C`data\-yaml@rt.cpan.org\*(C'\fR, or through the web interface at . .SH "SEE ALSO" .IX Header "SEE ALSO" YAML::Tiny, \s-1YAML\s0, YAML::Syck, Config::Tiny, CSS::Tiny .SH "AUTHOR" .IX Header "AUTHOR" Andy Armstrong \f(CW\*(C`\*(C'\fR .PP Adam Kennedy wrote YAML::Tiny which provided the template and many of the \s-1YAML\s0 matching regular expressions for this module. .SH "LICENCE AND COPYRIGHT" .IX Header "LICENCE AND COPYRIGHT" Copyright (c) 2007, Andy Armstrong \f(CW\*(C`\*(C'\fR. All rights reserved. .PP This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic. .SH "DISCLAIMER OF WARRANTY" .IX Header "DISCLAIMER OF WARRANTY" \&\s-1BECAUSE 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 \*(L"AS IS\*(R" 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.\s0 .PP \&\s-1IN 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\s0 (\s-1INCLUDING 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\s0), \s-1EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.\s0