NAME

YAML::LibYAML::API - Wrapper around the C libyaml library

SYNOPSIS

use YAML::LibYAML::API::XS;

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

my $yaml = <<'EOM';
# An example of various kinds of events
---
foo: &ALIAS bar
'alias': *ALIAS
tag: !!int 23
list:
- "doublequoted"
- >
  folded
- |-
  literal
EOM

# parse
my $events = [];
YAML::LibYAML::API::XS::parse_string_events($yaml, $events);
# or:
YAML::LibYAML::API::XS::parse_file_events($filename, $events);
YAML::LibYAML::API::XS::parse_filehandle_events($fh, $events);

# emit
my $yaml = YAML::LibYAML::API::XS::emit_string_events($events);
# or:
YAML::LibYAML::API::XS::emit_file_events($filename, $events);
YAML::LibYAML::API::XS::emit_filehandle_events($fh, $events);

DESCRIPTION

This module provides a thin wrapper around the C libyaml API.

Currently it provides functions for parsing and emitting events.

libyaml also provides a loader/dumper API to load/dump YAML into a list of nodes. There's no wrapper for these functions yet.

This is just one of the first releases. The function names will eventually be changed.

The sources of libyaml-dev are included in this distribution. You can build this module with the system libyaml instead, if you remove the libyaml sources and call Makefile.PL with WITH_SYSTEM_LIBYAML=1.

SEE ALSO

libyaml
YAML::XS

AUTHOR

Tina Müller <tinita@cpan.org>

COPYRIGHT AND LICENSE

Copyright 2018 by Tina Müller

This library is free software and may be distributed under the same terms as perl itself.