Data::Object::Yaml
Data-Object Yaml Class
use Data::Object::Yaml; my $yaml = Data::Object::Yaml->new; my $data = $yaml->from($arg);
Data::Object::Yaml provides methods for reading and writing YAML data.
This package implements the following methods.
# given $yaml my $string = $yaml->dump($data); # '--- {name: ...}'
The dump method converts a data structure into a YAML string.
# given $yaml my $data = $yaml->from($string); # {,...} my $string = $yaml->from($data); # '--- {foo: ...}'
The from method calls dump or load based on the give data.
dump
load
# given $yaml my $data = $yaml->load($string); # {,...}
The load method converts a string into a Perl data structure.
# given $yaml my $data = $yaml->read($file); # {,...}
The read method reads YAML from the given file and returns a data structure.
# given $yaml my $string = $yaml->write($file, $data); # ...
The write method writes the given data structure to a file as a YAML string.
# given $yaml my $space = $yaml->space(); # YAML::Tiny
The space method returns a Data::Object::Space object for the origin.
origin
# given $yaml my $path = $yaml->file($file); # ...
The file method returns a Data::Object::Path object for the given file.
# given $yaml my $origin = $yaml->origin(); # YAML::Tiny
The origin method returns the package name of the underlying YAML library used.
To install Data::Object, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Data::Object
CPAN shell
perl -MCPAN -e shell install Data::Object
For more information on module installation, please visit the detailed CPAN module installation guide.